feat: add catalog audit page
Checks for: - items_base entries without catalog_items (not purchasable) - catalog_items referencing non-existent items_base - Items without .nitro or icon files on disk - Duplicate classnames - Items missing from all configured clone sources
This commit is contained in:
1 parent
90107c83d5
commit
19e4e10b1d
6 files changed
+607
-1
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import { withAdmin } from "@/lib/api-handler";
|
||||
import { apiError, apiOk } from "@/lib/api-response";
|
||||
import { PERMS } from "@/lib/permissions";
|
||||
import { runCatalogAudit } from "@/lib/services/catalog-audit";
|
||||
|
||||
export const POST = withAdmin({ permission: PERMS.ASSETS_IMPORT }, async () => {
|
||||
try {
|
||||
const result = await runCatalogAudit();
|
||||
return apiOk(result as unknown as Record<string, unknown>);
|
||||
} catch (err) {
|
||||
return apiError(`Audit failed: ${(err as Error).message}`, 500);
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user