保誠-保戶業務員媒合平台
Tomas
2023-08-05 80b723216ca016f0438866cc99f6695c22990514
PAMapp/shared/services/query-consultant.service.ts
@@ -30,10 +30,26 @@
    return http.post('/consultant/favorite', payload);
  }
  // 預約前詢問
  /**
   * 預約需求
   * @param data 包含預約需求相關資訊的物件
   * @returns 回傳預約需求結果
   */
  async appointmentDemand(data: AppointmentParams) {
    return http.post('/appointment/customer/create', data).then((res) => res.data);
    try {
      const response = await http.post('/appointment/customer/create', data);
      if (response !== null) {
        return response.data;
      } else {
        throw new Error('http.post returned null-like value.');
  }
    } catch (error) {
      // 可以在此處處理錯誤或回傳預設值
      console.error('An error occurred while creating appointment demand:', error);
      throw error;
    }
  }
}