-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.ts
More file actions
31 lines (27 loc) · 1.15 KB
/
index.ts
File metadata and controls
31 lines (27 loc) · 1.15 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
import axiosInstance from '@/api/axiosInstance';
import { END_POINT } from '@/api/constant/endPoint';
import type { JobResponse } from '@/api/domain/signup/type/JobResponse';
import type { PersonaResponse } from '@/api/domain/signup/type/PersonaResponse';
import type { SignupResponse } from '@/api/domain/signup/type/SignupResponse';
import type { UserType } from '@/store/types/authTypes';
import type { BaseResponse } from '@/type/api';
export const getJobList = async () => {
const { data } = await axiosInstance.get<BaseResponse<JobResponse>>('/jobs');
return data.data;
};
export const getPersona = async () => {
const { data } = await axiosInstance.get<BaseResponse<PersonaResponse>>(`/${END_POINT.PERSONA}`);
return data.data;
};
export const postSignUp = async (payload: SignupResponse) => {
const { data } = await axiosInstance.post('/auth/signup', payload);
return data.data;
};
export const getUser = async () => {
const { data } = await axiosInstance.get<BaseResponse<UserType>>('/users/info');
return data.data;
};
export const postLogout = async () => {
const { data } = await axiosInstance.post('/auth/logout');
return data.data;
};