feat : update
CI / Verify (push) Successful in 1m25s
CI / Build immutable images and deploy (push) Has been cancelled

This commit is contained in:
2026-09-06 15:07:28 +07:00 Unverified
parent c3a7a44d02
commit 03149a1499
15 changed files with 4162 additions and 18 deletions
+16 -2
View File
@@ -28,7 +28,6 @@ import {
permanentlyDeleteGuide,
reorderExtraSections,
restoreGuide,
runCatalogSync,
saveArtifacts,
saveConstellations,
saveExtraSection,
@@ -39,6 +38,11 @@ import {
trashGuide,
updateGuideBasics,
} from "@/lib/guides/mutations";
import {
cancelCatalogSyncJob,
getCatalogSyncJob,
startCatalogSyncJob,
} from "@/lib/catalog/sync";
const serializedBlockSchema = z.strictObject({
id: z.string().uuid(),
@@ -362,12 +366,22 @@ export async function deleteStructuredGuide(guideId: string) {
export async function startCatalogSync() {
await requireAdmin();
try {
return await runCatalogSync();
return { status: "started" as const, job: await startCatalogSyncJob() };
} catch (cause) {
return { status: "error" as const, message: cause instanceof Error ? cause.message : "เริ่ม Sync ไม่สำเร็จ" };
}
}
export async function getCatalogSyncProgress(jobId: string) {
await requireAdmin();
return getCatalogSyncJob(jobId);
}
export async function cancelCatalogSync(jobId: string) {
await requireAdmin();
return cancelCatalogSyncJob(jobId);
}
export async function addGlossaryAlias(input: unknown) {
await requireAdmin();
try {