-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.ts
More file actions
39 lines (35 loc) · 1.31 KB
/
user.ts
File metadata and controls
39 lines (35 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { axiosClient } from '../../../shared/types/api/http-client';
import { TermsAgreementRequest, UserInfoRequest, UserInfoResponse } from '../model/userInformation';
export const readUser = async (): Promise<UserInfoResponse> => {
const response = await axiosClient.get<{ result: UserInfoResponse }>('/users', {
headers: { isPublicApi: true },
});
return response.data.result;
};
export const updateUser = async (data: UserInfoRequest): Promise<UserInfoResponse> => {
const response = await axiosClient.put<UserInfoResponse>('/users', data, {
headers: { isPublicApi: true },
});
return response.data;
};
// 이용 약관
export const agreeTerms = async (data: TermsAgreementRequest) => {
const response = await axiosClient.post('/terms', data, {
headers: { isPublicApi: true },
});
return response.data;
};
//인증번호 발급
export const sendCertificationCode = async (data: { phoneNumber: string }) => {
const response = await axiosClient.post('/sms/send', data, {
headers: { isPublicApi: true },
});
return response.data;
};
//인증번호 검증
export const verifyCertificationCode = async (data: {phoneNumber: string, certificationCode: string}) => {
const response = await axiosClient.post('/sms/verify', data, {
headers: { isPublicApi: true },
});
return response.data;
};