mirror of
https://github.com/20kaushik02/spotify-manager-web.git
synced 2025-12-06 06:34:06 +00:00
26 lines
675 B
TypeScript
26 lines
675 B
TypeScript
import type { AxiosResponse } from "axios";
|
|
import { type apiRespBaseType, axiosInstance } from "./axiosInstance.ts";
|
|
import { authHealthCheckURL, authRefreshURL } from "./paths.ts";
|
|
|
|
export const apiAuthCheck = async (): Promise<
|
|
AxiosResponse<apiRespBaseType, any>
|
|
> => {
|
|
try {
|
|
const response = await axiosInstance.get(authHealthCheckURL);
|
|
return response;
|
|
} catch (error: any) {
|
|
return error.response;
|
|
}
|
|
};
|
|
|
|
export const apiAuthRefresh = async (): Promise<
|
|
AxiosResponse<apiRespBaseType, any>
|
|
> => {
|
|
try {
|
|
const response = await axiosInstance.get(authRefreshURL);
|
|
return response;
|
|
} catch (error: any) {
|
|
return error.response;
|
|
}
|
|
};
|