This commit is contained in:
Xeltica 2021-01-06 02:23:58 +09:00
parent 929b9be3de
commit 09f4006326

View File

@ -15,7 +15,7 @@ export const api = <T = Record<string, unknown>>(host: string, endpoint: string,
return axios.post<T>(`https://${host}/api/${endpoint}`, a).then(res => res.data);
};
export const apiAvailable = async (host: string, i: string) : Promise<boolean> => {
export const apiAvailable = async (host: string, i: string): Promise<boolean> => {
try {
const res = await api(host, 'i', {}, i);
return !res.error;