Prevent duplicate equipment builds occuring when renaming an existing build

This commit is contained in:
Dev 2024-02-05 09:13:37 +00:00
parent 946172d20c
commit 0f6b34605b

View File

@ -122,7 +122,9 @@ export class BuildController
Items: request.Items,
};
const existingBuild = existingSavedEquipmentBuilds.find((x) => x.Name === request.Name);
const existingBuild = existingSavedEquipmentBuilds.find((build) =>
build.Name === request.Name || build.Id === request.Id
);
if (existingBuild)
{
// Already exists, replace