fix: SQL maker creates wrong categories and badge import fails when ExternalTexts.json missing
- writeSqlMigration now classifies furni via classifyFurni and generates correct category sub-pages (imp_<catKey>) instead of hardcoded imp_other - writeSqlMigration generates idempotent INSERT...SELECT WHERE NOT EXISTS for parent and category catalog_pages, with correct numeric page_id - writeBadgeToExternalTexts creates ExternalTexts.json (and parent dirs) when missing instead of failing with ENOENT
This commit is contained in:
1 parent
1851653afb
commit
4d4cbd2211
3 files changed
+60
-15
No files matched your search
@@ -62,6 +62,8 @@ vi.mock("@/lib/services/furni-import", () => ({
|
||||
async (insertFn: (nextId: number) => Promise<unknown>) => insertFn(701),
|
||||
),
|
||||
autoPriceFurni: vi.fn(() => ({ credits: 3, points: 0, pointsType: 0 })),
|
||||
CATEGORY_PAGE: {},
|
||||
classifyFurni: vi.fn(() => "other"),
|
||||
ensureDirectories: vi.fn(async () => {
|
||||
const dirs = [
|
||||
assetTargets.swfDir,
|
||||
@@ -76,6 +78,8 @@ vi.mock("@/lib/services/furni-import", () => ({
|
||||
await Promise.all(dirs.map((dir) => fs.mkdir(dir, { recursive: true })));
|
||||
}),
|
||||
getOrCreateCategoryPage: getOrCreateCategoryPageMock,
|
||||
IMPORTED_PAGE_CAPTION: "Imported Furniture",
|
||||
IMPORTED_PAGE_CAPTION_SAVE: "imported_furni",
|
||||
}));
|
||||
|
||||
vi.mock("@/lib/services/swf/nitro-builder", () => ({
|
||||
|
||||
Reference in new issue
Block a user