fix: unique item name on edit mode.

This commit is contained in:
a.bouhuolia
2021-01-02 16:18:54 +02:00
parent e266889df6
commit ed4c49883c

View File

@@ -335,6 +335,9 @@ export default class ItemsService implements IItemsService {
// Validates the given item existance on the storage.
const oldItem = await this.getItemOrThrowError(tenantId, itemId);
// Validate whether the given item name already exists on the storage.
await this.validateItemNameUniquiness(tenantId, itemDTO.name, itemId);
// Validate the item category existance on the storage,
if (itemDTO.categoryId) {
await this.validateItemCategoryExistance(tenantId, itemDTO.categoryId);