feat: export Catalog Studio assets and SQL to catalog repository
This commit is contained in:
1 parent
bfbf244141
commit
9ec9ab31ad
21 files changed
+1811
-514
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import { withAdmin } from "@/lib/api-handler";
|
||||
import { apiError, apiOk } from "@/lib/api-response";
|
||||
import { PERMS } from "@/lib/permissions";
|
||||
import {
|
||||
catalogExportEnabled,
|
||||
catalogExportQueue,
|
||||
catalogExportStatus,
|
||||
} from "@/lib/services/catalog-git-queue";
|
||||
|
||||
export const GET = withAdmin({ permission: PERMS.ASSETS_IMPORT }, async () =>
|
||||
apiOk(await catalogExportStatus()),
|
||||
);
|
||||
export const POST = withAdmin({ permission: PERMS.ASSETS_IMPORT }, async () => {
|
||||
if (!catalogExportEnabled())
|
||||
return apiError("Catalog repository export is not configured", 400);
|
||||
await catalogExportQueue().request();
|
||||
return apiOk(await catalogExportStatus());
|
||||
});
|
||||
Reference in new issue
Block a user