refactor
This commit is contained in:
parent
929b9be3de
commit
09f4006326
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user