diff --git a/project/src/models/spt/mod/NewItemDetails.ts b/project/src/models/spt/mod/NewItemDetails.ts index 3b9c60c5..3ba66224 100644 --- a/project/src/models/spt/mod/NewItemDetails.ts +++ b/project/src/models/spt/mod/NewItemDetails.ts @@ -53,6 +53,7 @@ export class CreateItemResult constructor() { this.success = false; + this.errors = []; } success: boolean; diff --git a/project/src/services/mod/CustomItemService.ts b/project/src/services/mod/CustomItemService.ts index 69fc9363..2f5954d5 100644 --- a/project/src/services/mod/CustomItemService.ts +++ b/project/src/services/mod/CustomItemService.ts @@ -55,6 +55,9 @@ export class CustomItemService if (tables.templates.items[newItemId]) { result.errors.push(`ItemId already exists. ${tables.templates.items[newItemId]._name}`); + result.success = false; + result.itemId = newItemId; + return result; }