Files
simple-admin/src/shared/config/api/auth/api.ts
Samandar Turgunboyev 05b752daf2 api ulandi
2025-10-25 18:42:01 +05:00

23 lines
635 B
TypeScript

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 };