From 863699eb004f0f8024371a16c43079651705810f Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期六, 05 八月 2023 18:10:31 +0800 Subject: [PATCH] Fixed: [弱掃] p20.1 Bad use of null-like value --- PAMapp/pages/satisfactionList.vue | 33 +++++++++++++++++++++------------ 1 files changed, 21 insertions(+), 12 deletions(-) diff --git a/PAMapp/pages/satisfactionList.vue b/PAMapp/pages/satisfactionList.vue index dbf2330..57e9110 100644 --- a/PAMapp/pages/satisfactionList.vue +++ b/PAMapp/pages/satisfactionList.vue @@ -89,20 +89,29 @@ /////////////////////////////////////////////////////// - sent() { + async sent() { const reviewParams: UserReviewParams[] = this.mapUnReviewLogList - .filter(item => item.satisfaction > 0) - .map(item => { - return { - appointmentId: item.appointmentId, - score: item.satisfaction, - type: item.type - } - }) + .filter(item => item.satisfaction > 0) + .map(item => { + return { + appointmentId: item.appointmentId, + score: item.satisfaction, + type: item.type + }; + }); - reviewsService.allUserReviewsConsultants(reviewParams).then((res) => { - this.showConfirmPopup = true; - }); + try { + const response = await reviewsService.allUserReviewsConsultants(reviewParams); + if (response !== null) { + this.showConfirmPopup = true; + } else { + throw new Error('reviewsService.allUserReviewsConsultants returned null-like value.'); + } + } catch (error) { + console.error('An error occurred while sending reviews:', error); + // �隞亙甇方���隤斗����身�� + throw error; + } } closePopup() { -- Gitblit v1.8.0