fix : check duplicate product
This commit is contained in:
@@ -1454,7 +1454,7 @@ class ProductService {
|
|||||||
//**************************************************************
|
//**************************************************************
|
||||||
//****method to check for duplicate product
|
//****method to check for duplicate product
|
||||||
private async checkForDuplicateProduct(model: string) {
|
private async checkForDuplicateProduct(model: string) {
|
||||||
const exist = await this.productRepo.model.exists({ model });
|
const exist = await this.productRepo.model.exists({ model, deleted: false });
|
||||||
if (exist) throw new BadRequestError(ProductMessage.DuplicateName);
|
if (exist) throw new BadRequestError(ProductMessage.DuplicateName);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user