保誠-保戶業務員媒合平台
Tomas
2023-08-05 4acd58f884adc6c09543d4e780025567dc048d5b
Fixed: [弱掃] p7-Bad use of null-like value
修改1個檔案
20 ■■■■■ 已變更過的檔案
PAMapp/shared/services/appointment.service.ts 20 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/shared/services/appointment.service.ts
@@ -45,11 +45,27 @@
    return http.post('/appointment/memo/create', memoInfo).then(res => res.data);
  }
  // 編輯註記
  /**
   * 編輯註記
   * @param memoInfo 包含編輯註記相關資訊的物件
   * @returns 回傳更新後的註記資訊
   */
  async updateMemo(memoInfo: updatedMemoInfo): Promise<AppointmentMemoInfo> {
    return http.post('/appointment/memo/update', memoInfo).then(res => res.data);
    try {
      const response = await http.post('/appointment/memo/update', memoInfo);
      if (response !== null) {
        return response.data;
      } else {
        throw new Error('http.post returned null-like value.');
      }
    } catch (error) {
      // 可以在此處處理錯誤或回傳預設值
      console.error('An error occurred while updating memo:', error);
      throw error;
    }
  }
  // 刪除註記
  deleteMemo(appointmentMemoId: number) {
    return http.delete(`/appointment/memo/${appointmentMemoId}`)