From 4026158bc3b505f5b9326d88337e608ab7a7553e Mon Sep 17 00:00:00 2001 From: CessnaJ Date: Sun, 21 Jan 2024 02:53:27 +0900 Subject: [PATCH] =?UTF-8?q?[FIX]=20=EB=AA=A8=EB=91=90=EB=8B=A4=EC=9A=B4?= =?UTF-8?q?=EB=A1=9C=EB=93=9C=20=EB=A1=9C=EC=A7=81=20=EB=B3=B5=EA=B5=AC=20?= =?UTF-8?q?=EC=9D=B4=ED=9B=84=20=EC=9C=84=EC=B9=98=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/notification/notification.ts | 6 ++-- .../ProductDetailCouponModal.vue | 28 +++++++++---------- src/stores/notification/NotificationStore.ts | 4 +-- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/apis/notification/notification.ts b/src/apis/notification/notification.ts index bad1838b..b2041875 100644 --- a/src/apis/notification/notification.ts +++ b/src/apis/notification/notification.ts @@ -112,9 +112,9 @@ export const subscribeToNotifications = ( // console.log('하트비트 외 모든 메세지 수신') } - console.log('새로운 메세지가 도착했습니다.') - console.log(event.data) - console.log(event) + // console.log('새로운 메세지가 도착했습니다.') + // console.log(event.data) + // console.log(event) onMessage(notification) } diff --git a/src/components/promotion/coupon/productdetail/ProductDetailCouponModal.vue b/src/components/promotion/coupon/productdetail/ProductDetailCouponModal.vue index 77897f59..dfcb9c12 100644 --- a/src/components/promotion/coupon/productdetail/ProductDetailCouponModal.vue +++ b/src/components/promotion/coupon/productdetail/ProductDetailCouponModal.vue @@ -138,15 +138,15 @@ const handleDownloadMultipleCoupons = async () => { const downloadResponse: MultipleCouponDownloadResponse = await downloadMultipleCoupons(downloadableCouponInfoIds) - // 다운로드 된 쿠폰들 상태변경 - coupons.value = coupons.value.map((coupon) => { + coupons.value.forEach((coupon, index) => { + // 다운로드 된 쿠폰들 상태변경 if (downloadResponse.successfulIds.includes(coupon.couponInfoId)) { - return { ...coupon, isDownloadable: false } // 상태 업데이트 + coupons.value[index].isDownloadable = false } - return coupon }) - console.log('다운로드된 couponInfoId 목록:', downloadResponse.successfulIds) - console.log('다운로드 실패한 couponInfoId 목록:', downloadResponse.failedIds) + + // console.log('다운로드된 couponInfoId 목록:', downloadResponse.successfulIds) + // console.log('다운로드 실패한 couponInfoId 목록:', downloadResponse.failedIds) await successModal( '알림', @@ -170,28 +170,28 @@ const maxDiscountAmount = computed(() => { for (const coupon of coupons.value) { let discountAmount = 0 - console.log(`임시 discountAmount 초기화:${discountAmount}`) + // console.log(`임시 discountAmount 초기화:${discountAmount}`) // 할인 타입에 따라 분기 if (coupon.discountType === 'PERCENTAGE') { discountAmount = (productPriceValue * coupon.discountValue) / 100 - console.log(`PERCENTAGE:${coupon}`) - console.log(`discountAmount:${discountAmount}`) + // console.log(`PERCENTAGE:${coupon}`) + // console.log(`discountAmount:${discountAmount}`) } else if (coupon.discountType === 'FIXED_AMOUNT') { discountAmount = coupon.discountValue - console.log(`FIXED_AMOUNT:${coupon}`) - console.log(`discountAmount:${discountAmount}`) + // console.log(`FIXED_AMOUNT:${coupon}`) + // console.log(`discountAmount:${discountAmount}`) } // maxDiscountAmount가 있다면 해당 쿠폰 할인이 해당 limit을 안넘는지 확인 discountAmount = Math.min(discountAmount, coupon.maxDiscountAmount ?? Infinity) - console.log(`max처리 후 임시 discountAmount:${discountAmount}`) + // console.log(`max처리 후 임시 discountAmount:${discountAmount}`) // max값 갱신 maxDiscount = Math.max(maxDiscount, discountAmount) - console.log(`갱신 후 임시 maxDiscount:${maxDiscount}`) + // console.log(`갱신 후 임시 maxDiscount:${maxDiscount}`) } - console.log(`최종 계산완료 된 maxDiscount:${maxDiscount}`) + // console.log(`최종 계산완료 된 maxDiscount:${maxDiscount}`) emit('best-promotional-price-updated', maxDiscount) // computed로 변경시 emit diff --git a/src/stores/notification/NotificationStore.ts b/src/stores/notification/NotificationStore.ts index 7e99e2b7..6c65d2f4 100644 --- a/src/stores/notification/NotificationStore.ts +++ b/src/stores/notification/NotificationStore.ts @@ -90,7 +90,7 @@ export const useNotificationStore = defineStore( } const subscribeToNotificationsHandler = () => { - console.log('subscribeToNotificationsHandler를 발동') + // console.log('subscribeToNotificationsHandler를 발동') if (!shouldSubscribeToSSE.value) { // orderSuccessView에서 SSE연결을 하지 않게 제어. 뒤로가기 누를 수 있으니 사이드이펙트 방지용으로 1회성 차단으로 설정 @@ -109,7 +109,7 @@ export const useNotificationStore = defineStore( eventSourceUnsubscribe = notificationApi.subscribeToNotifications( (notification: Notification) => { - console.log('구독 후 의미있는 알림을 받았습니다.') + // console.log('구독 후 의미있는 알림을 받았습니다.') // console.log('토스트 알림을 띄웁니다.') notifications.value.unshift(notification) unreadNotificationCount.value++