Fix error when created multiple items with the same unique ID (!269)
Fixes issue #592 https://dev.sp-tarkov.com/SPT-AKI/Issues/issues/592 Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/269 Co-authored-by: Leaves <mwarciel@gmail.com> Co-committed-by: Leaves <mwarciel@gmail.com>
This commit is contained in:
parent
757c4506f5
commit
0bb7d1d350
@ -53,6 +53,7 @@ export class CreateItemResult
|
|||||||
constructor()
|
constructor()
|
||||||
{
|
{
|
||||||
this.success = false;
|
this.success = false;
|
||||||
|
this.errors = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
success: boolean;
|
success: boolean;
|
||||||
|
@ -55,6 +55,9 @@ export class CustomItemService
|
|||||||
if (tables.templates.items[newItemId])
|
if (tables.templates.items[newItemId])
|
||||||
{
|
{
|
||||||
result.errors.push(`ItemId already exists. ${tables.templates.items[newItemId]._name}`);
|
result.errors.push(`ItemId already exists. ${tables.templates.items[newItemId]._name}`);
|
||||||
|
result.success = false;
|
||||||
|
result.itemId = newItemId;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user