From 8a8adb06237556f47e397e9871cce806616b1643 Mon Sep 17 00:00:00 2001 From: morteza-mortezai Date: Tue, 10 Feb 2026 09:14:43 +0330 Subject: [PATCH] bug --- src/modules/coupons/providers/coupon.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/coupons/providers/coupon.service.ts b/src/modules/coupons/providers/coupon.service.ts index 46985be..dc69a57 100644 --- a/src/modules/coupons/providers/coupon.service.ts +++ b/src/modules/coupons/providers/coupon.service.ts @@ -17,7 +17,7 @@ export class CouponService { private readonly couponRepository: CouponRepository, private readonly restRepository: RestRepository, private readonly em: EntityManager, - ) {} + ) { } async create(restId: string, createCouponDto: CreateCouponDto): Promise { const restaurant = await this.restRepository.findOne({ id: restId }); @@ -257,7 +257,7 @@ export class CouponService { return prefix + '-' + result; } - async generateCouponCode(restId: string){ + async generateCouponCode(restId: string): Promise<{ code: string }> { const restaurant = await this.restRepository.findOne({ id: restId }); if (!restaurant) { throw new NotFoundException(RestMessage.NOT_FOUND); @@ -266,6 +266,6 @@ export class CouponService { const existing = await this.couponRepository.findOne({ code, restaurant: { id: restId } }); if (existing) return this.generateCouponCode(restId); - return {code}; + return { code }; } }