Add updateExisting option to furniture import
- Added updateExisting parameter to importSingleFurni and API routes - When updateExisting=true, existing items are updated (catalog price/page) instead of failing - Added catalogUpdated flag to ImportSingleResult - Updates existing catalog entries (price, page) instead of skipping duplicates
This commit is contained in:
1 parent
f89b8a6adf
commit
7ef5038a9e
3 files changed
+48
-15
No files matched your search
@@ -297,6 +297,7 @@ export const POST = withAdmin(
|
|||||||
type: item.type ?? "flooritem",
|
type: item.type ?? "flooritem",
|
||||||
revision: item.revision ?? 0,
|
revision: item.revision ?? 0,
|
||||||
category: item.category ?? "unknown",
|
category: item.category ?? "unknown",
|
||||||
|
updateExisting: body.updateExisting === true,
|
||||||
sourceSwfBaseUrl: source?.sourceSwfBaseUrl,
|
sourceSwfBaseUrl: source?.sourceSwfBaseUrl,
|
||||||
nitroBaseUrl: source?.nitroBaseUrl || undefined,
|
nitroBaseUrl: source?.nitroBaseUrl || undefined,
|
||||||
iconBaseUrl: source?.iconBaseUrl || undefined,
|
iconBaseUrl: source?.iconBaseUrl || undefined,
|
||||||
@@ -359,6 +360,7 @@ export const POST = withAdmin(
|
|||||||
revision,
|
revision,
|
||||||
category,
|
category,
|
||||||
sourceId,
|
sourceId,
|
||||||
|
updateExisting,
|
||||||
} = body;
|
} = body;
|
||||||
|
|
||||||
if (!classname || !name) return apiError("Missing classname or name", 400);
|
if (!classname || !name) return apiError("Missing classname or name", 400);
|
||||||
@@ -374,6 +376,7 @@ export const POST = withAdmin(
|
|||||||
type: type ?? "flooritem",
|
type: type ?? "flooritem",
|
||||||
revision: revision ?? 0,
|
revision: revision ?? 0,
|
||||||
category: category ?? "unknown",
|
category: category ?? "unknown",
|
||||||
|
updateExisting: updateExisting === true,
|
||||||
sourceSwfBaseUrl: source?.sourceSwfBaseUrl,
|
sourceSwfBaseUrl: source?.sourceSwfBaseUrl,
|
||||||
nitroBaseUrl: source?.nitroBaseUrl || undefined,
|
nitroBaseUrl: source?.nitroBaseUrl || undefined,
|
||||||
iconBaseUrl: source?.iconBaseUrl || undefined,
|
iconBaseUrl: source?.iconBaseUrl || undefined,
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -93,6 +93,7 @@ export interface ImportSingleResult {
|
|||||||
ok: boolean;
|
ok: boolean;
|
||||||
itemId?: number;
|
itemId?: number;
|
||||||
catalogItemId?: number | null;
|
catalogItemId?: number | null;
|
||||||
|
catalogUpdated?: boolean;
|
||||||
dimensions?: { x: number; y: number; z: number };
|
dimensions?: { x: number; y: number; z: number };
|
||||||
spriteCount?: number;
|
spriteCount?: number;
|
||||||
warnings: string[];
|
warnings: string[];
|
||||||
|
|||||||
Reference in new issue
Block a user