From c9c42db69871883cf8c28c66c0ecf1824c482c36 Mon Sep 17 00:00:00 2001 From: morteza-mortezai Date: Mon, 9 Feb 2026 12:51:21 +0330 Subject: [PATCH] up --- src/modules/products/providers/product.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/products/providers/product.service.ts b/src/modules/products/providers/product.service.ts index 8bba4ac..6acaf0b 100644 --- a/src/modules/products/providers/product.service.ts +++ b/src/modules/products/providers/product.service.ts @@ -180,7 +180,7 @@ export class ProductService { const product = await this.findOrFail(id) if (product.shop.id !== shopId) { - throw new BadRequestException("Product doesnt belongs to you") + throw new BadRequestException("Product doesnt belongs to your shop") } product.deletedAt = new Date(); @@ -194,13 +194,13 @@ export class ProductService { const favorite = await this.em.findOne(Favorite, { user: userId, product: productId }); if (favorite) { - return this.em.removeAndFlush(favorite); + return await this.em.removeAndFlush(favorite); } const newFavorite = this.em.create(Favorite, { user: userId, product: productId, }); - return this.em.persistAndFlush(newFavorite); + return await this.em.persistAndFlush(newFavorite); }