From dd0fdd6c956782b5cbc0700c15d239200d8f0120 Mon Sep 17 00:00:00 2001
From: Tomas <tomasysh@gmail.com>
Date: 星期二, 05 九月 2023 14:02:02 +0800
Subject: [PATCH] Fixed: PAM_0901_P6

---
 PAMapp/pages/questionnaire/_agentNo.vue |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/PAMapp/pages/questionnaire/_agentNo.vue b/PAMapp/pages/questionnaire/_agentNo.vue
index e8e39a8..7e7c52e 100644
--- a/PAMapp/pages/questionnaire/_agentNo.vue
+++ b/PAMapp/pages/questionnaire/_agentNo.vue
@@ -453,7 +453,7 @@
     ////////////////////////////////////////////////////////////////////////////
 
     async sentDemand() {
-      if (this.isEditBtn) {
+      if (typeof this.isEditBtn !== 'undefined' && this.isEditBtn) {
         await this.editAppointmentDemand();
       } else {
         // 雿輻 async/await 靘��甇交����蝯��
@@ -461,10 +461,16 @@
         const response = await queryConsultantService.addFavoriteConsultant(addFavoriteAgentList);
 
         // 蝣箔�甇交����蝯�� null ��� undefined
-        if (response !== null) {
-          await this.sentAppointmentDemand();
-        } else {
+        if (!response) {
           throw new Error('queryConsultantService.addFavoriteConsultant returned null-like value.');
+        } else {
+          if (typeof this.editAppointmentDemand === 'function') {
+            // 蝣箔�� this.editAppointmentDemand �銝���
+            await this.editAppointmentDemand();
+          } else {
+            // ���� this.editAppointmentDemand �摰儔�����
+            throw new Error('this.editAppointmentDemand is not defined or not a function.');
+          }
         }
       }
 

--
Gitblit v1.8.0