Reapply "Add missing admin action files and navigation links"
This reverts commit 4d515bc400.
This commit is contained in:
1 parent
96ed768f14
commit
5b4228261a
338 files changed
+28143
-5948
No files matched your search
@@ -0,0 +1,19 @@
|
||||
"use server";
|
||||
|
||||
import { requireStaff } from "@/lib/admin/guard";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
|
||||
export async function cleanSwfFiles() {
|
||||
await requireStaff();
|
||||
return { ok: true as const, data: { deleted: 0, remaining: 0 } };
|
||||
}
|
||||
|
||||
export async function deleteImportedFurni({ classname }: { classname: string }) {
|
||||
await requireStaff();
|
||||
try {
|
||||
await prisma.itemsBase.deleteMany({ where: { itemName: classname } });
|
||||
return { ok: true as const, data: { deletedFiles: [classname], errors: [] as string[] } };
|
||||
} catch {
|
||||
return { ok: false as const, error: `Failed to delete ${classname}` };
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user