@@ -52,7 +52,8 @@ export class PricingService {
|
|||||||
if (existType) throw new BadRequestError(PricingMessage.TypeIsExist);
|
if (existType) throw new BadRequestError(PricingMessage.TypeIsExist);
|
||||||
|
|
||||||
const pricing = await this.pricingRepo.model.findByIdAndUpdate(id, updateDto, { new: true });
|
const pricing = await this.pricingRepo.model.findByIdAndUpdate(id, updateDto, { new: true });
|
||||||
if (pricing) throw new BadRequestError(PricingMessage.NotFound);
|
|
||||||
|
if (!pricing) throw new BadRequestError(PricingMessage.NotFound);
|
||||||
return {
|
return {
|
||||||
pricing,
|
pricing,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user