refactor
This commit is contained in:
parent
929b9be3de
commit
09f4006326
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
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 {
|
try {
|
||||||
const res = await api(host, 'i', {}, i);
|
const res = await api(host, 'i', {}, i);
|
||||||
return !res.error;
|
return !res.error;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue