18 lines
502 B
TypeScript
18 lines
502 B
TypeScript
import { callApi, HTTP } from "../tools";
|
|
import {
|
|
IFetchLoginRequest,
|
|
IFetchLoginResponse,
|
|
IFetchRefreshResponse,
|
|
} from "./types";
|
|
|
|
const fetchLoginApi = async (
|
|
request: IFetchLoginRequest,
|
|
): Promise<IFetchLoginResponse> => {
|
|
return await callApi(HTTP.POST, `auth/login`, request, true);
|
|
};
|
|
|
|
const fetchRefreshApi = async (): Promise<IFetchRefreshResponse> => {
|
|
return await callApi(HTTP.GET, `auth/refresh`, undefined, true);
|
|
};
|
|
|
|
export { fetchLoginApi, fetchRefreshApi };
|