Split OnlineUsersWidget from StatusCard, decouple ad delete button, sync badge import to ExternalTexts+WebsiteBadges, add Import section hub with cancelable SSE jobs and upload SQL option. Co-authored-by: Cursor <[email protected]>
23 lines
541 B
TypeScript
23 lines
541 B
TypeScript
"use server";
|
|
|
|
import { requirePermission } from "@/lib/admin/guard";
|
|
import { PERMS } from "@/lib/permissions";
|
|
import { importBadgeSynced } from "@/lib/services/import-badge";
|
|
|
|
export async function importBadgeFromRemote({
|
|
code,
|
|
name,
|
|
description,
|
|
}: {
|
|
code: string;
|
|
name: string;
|
|
description: string;
|
|
}) {
|
|
await requirePermission(PERMS.ASSETS_IMPORT);
|
|
const result = await importBadgeSynced({ code, name, description });
|
|
if (!result.ok) {
|
|
return { ok: false as const, error: result.error };
|
|
}
|
|
return { ok: true as const };
|
|
}
|