mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
fix: unique item name on edit mode.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user