api ulandi
This commit is contained in:
22
src/shared/config/api/auth/api.ts
Normal file
22
src/shared/config/api/auth/api.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import type { LoginData, MeData } from "@/shared/config/api/auth/auth.model";
|
||||
import httpClient from "@/shared/config/api/httpClient";
|
||||
import { AUTH_LOGIN, GET_ME } from "@/shared/config/api/URLs";
|
||||
import type { AxiosResponse } from "axios";
|
||||
|
||||
const authLogin = async ({
|
||||
phone,
|
||||
password,
|
||||
}: {
|
||||
phone: string;
|
||||
password: string;
|
||||
}): Promise<AxiosResponse<LoginData>> => {
|
||||
const response = await httpClient.post(AUTH_LOGIN, { phone, password });
|
||||
return response;
|
||||
};
|
||||
|
||||
const getMe = async (): Promise<AxiosResponse<MeData>> => {
|
||||
const response = await httpClient.get(GET_ME);
|
||||
return response;
|
||||
};
|
||||
|
||||
export { authLogin, getMe };
|
||||
Reference in New Issue
Block a user