feat: Auto-fix cost_credits <= 0 to 3 on every furniture import
- Extended fixDatabaseConsistencyAfterImport() to also set cost_credits = 3 where <= 0 - Integrated into both single and batch import routes - API responses now include costCreditsFixed count Ensures 100% of catalog_items have cost_credits > 0 after import - Typecheck, lint, tests all pass - Pushed to GitLab
This commit is contained in:
1 parent
86f3d82c5d
commit
0b0cf4f37f
3 files changed
+30
-14
No files matched your search
@@ -266,8 +266,9 @@ export const POST = withAdmin(
|
||||
);
|
||||
}
|
||||
|
||||
// Fix database consistency (catalog_name + have_offer) after import
|
||||
const dbFix = await fixDatabaseConsistencyAfterImport();
|
||||
// Fix database consistency (catalog_name + have_offer + cost_credits) after import
|
||||
const { catalogNameFixed, haveOfferFixed, costCreditsFixed } =
|
||||
await fixDatabaseConsistencyAfterImport();
|
||||
|
||||
send({
|
||||
type: "batch_complete",
|
||||
@@ -285,8 +286,9 @@ export const POST = withAdmin(
|
||||
offerRebuildFixed,
|
||||
spriteFixed,
|
||||
interactionFixed,
|
||||
catalogNameFixed: dbFix.catalogNameFixed,
|
||||
haveOfferFixed: dbFix.haveOfferFixed,
|
||||
catalogNameFixed,
|
||||
haveOfferFixed,
|
||||
costCreditsFixed,
|
||||
languages,
|
||||
duration: Date.now() - startTime,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user