From 3e8c86ebf61df1ac5c9dfd96c7a829a2cd9ec4a2 Mon Sep 17 00:00:00 2001
From: Mila <Mila@pollex.com.tw>
Date: 星期一, 15 十一月 2021 17:55:59 +0800
Subject: [PATCH] TODO#130023 客戶預約清單: 串接標註已聯絡 api

---
 PAMapp/assets/ts/api/consultant.ts |   52 ++++++----------------------------------------------
 1 files changed, 6 insertions(+), 46 deletions(-)

diff --git a/PAMapp/assets/ts/api/consultant.ts b/PAMapp/assets/ts/api/consultant.ts
index 32789aa..16a86b9 100644
--- a/PAMapp/assets/ts/api/consultant.ts
+++ b/PAMapp/assets/ts/api/consultant.ts
@@ -1,24 +1,5 @@
-import axios from 'axios';
-import { AxiosRequestConfig, AxiosError, AxiosResponse } from 'axios';
-import { MessageBox } from 'element-ui';
-import { functionsIn } from 'lodash';
-import Router from 'vue-router';
-
-export const service = axios.create({
-    baseURL: process.env.BASE_URL
-})
-
-service.interceptors.request.use(function (config: AxiosRequestConfig) {
-    return config;
-}, function (error: AxiosError) {
-    return Promise.reject(error);
-});
-
-service.interceptors.response.use(function (response: AxiosResponse) {
-    return response;
-}, function (error: AxiosError) {
-    return Promise.reject(error);
-});
+import { service } from '~/assets/ts/api/share';
+import { AxiosResponse } from 'axios';
 
 // 憿批恥��(TODO: OTP隤����� ���蝙�)
 export function login(user: any) {
@@ -58,7 +39,10 @@
 
 // ����岷���
 export function appointmentDemand(data: AppointmentParams) {
-    return service.post('/appointment/customer/create', data)
+    const headers = {
+        Authorization: 'Bearer ' + localStorage.getItem('id_token')
+    }
+    return service.post('/appointment/customer/create', data, {headers})
 }
 
 //憿批�底蝝啗���
@@ -66,13 +50,6 @@
     return service.get('/consultant/detail', {params:{agentNo:agentNo}})
 }
 
-// ���������
-export function getMyAppointmentList():Promise<AxiosResponse<ClientInfo>> {
-    const headers = {
-        Authorization: 'Bearer ' + localStorage.getItem('id_token')
-    }
-    return service.get('/consultant/getMyAppointment', {headers});
-}
 export interface Consultants {
     agentNo: string,
     name: string,
@@ -127,20 +104,3 @@
     new:           boolean;
 }
 
-export interface ClientInfo {
-    id: number,
-    phone: string,
-    email: string,
-    contactType: string,
-    gender: string,
-    age: string,
-    job: string,
-    requirement: string,
-    communicateStatus: string,
-    hopeContactTime: string,
-    otherRequirement: string,
-    appointmentDate: Date,
-    agentNo: string,
-    customerId: number,
-    name: string
-}
\ No newline at end of file

--
Gitblit v1.8.0