From e828225de7636d0195db2c3c9b1701a5b2f12049 Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期四, 14 九月 2023 18:01:33 +0800 Subject: [PATCH] Merge branch '滲透' of https://dev.pollex.com.tw:8443/r/pcalife/PAM into 滲透 --- PAMapp/components/Client/ClientCard.vue | 24 +++++++++++++++++------- 1 files changed, 17 insertions(+), 7 deletions(-) diff --git a/PAMapp/components/Client/ClientCard.vue b/PAMapp/components/Client/ClientCard.vue index 051bc23..5889940 100644 --- a/PAMapp/components/Client/ClientCard.vue +++ b/PAMapp/components/Client/ClientCard.vue @@ -306,14 +306,24 @@ this.clearAppointmentIdFromMsg(); } - private readAppointment(): void { - appointmentService.recordRead(this.client.id).then((_) => { - const updatedClient = {...this.client}; - updatedClient.consultantReadTime = new Date().toString(); - this.updateMyAppointmentList(updatedClient); - this.updateAppointmentDetail(this.client.id); - }); + private async readAppointment(): Promise<void> { + try { + const response = await appointmentService.recordRead(this.client.id); + if (response !== null) { + const updatedClient = { ...this.client }; + updatedClient.consultantReadTime = new Date().toString(); + this.updateMyAppointmentList(updatedClient); + this.updateAppointmentDetail(this.client.id); + } else { + throw new Error('appointmentService.recordRead returned null-like value.'); + } + } catch (error) { + console.error('An error occurred while reading appointment:', error); + // �隞亙甇方���隤斗����身�� + throw error; } + } + private clearAppointmentIdFromMsg() { this.storageClearAppointmentIdFromMsg(); -- Gitblit v1.8.0