| | |
| | | import { http } from "./httpClient"; |
| | | |
| | | import { UserSetting } from "~/shared/models/account.model"; |
| | | import { AgentInfoSetting, UserSetting } from "~/shared/models/account.model"; |
| | | |
| | | class AccountSettingService{ |
| | | |
| | |
| | | return http.put('/customer/info', params ).then(res => res.data); |
| | | } |
| | | |
| | | //編輯顧問帳號資訊 |
| | | async editAgentInfoSetting(params: any): Promise<AgentInfoSetting> { |
| | | try { |
| | | const response = await http.post('/consultant/edit', params); |
| | | if (response !== null) { |
| | | return response.data; |
| | | } else { |
| | | throw new Error('http.post returned null-like value.'); |
| | | } |
| | | } catch (error) { |
| | | console.error('An error occurred while editing agent info setting:', error); |
| | | // 可以在此處處理錯誤或回傳預設值 |
| | | throw error; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | export default new AccountSettingService(); |