20 lines
No EOL
461 B
TypeScript
20 lines
No EOL
461 B
TypeScript
import axios from "axios";
|
|
import { apiUrl } from "./api";
|
|
|
|
export interface Server {
|
|
name?: string;
|
|
id: number;
|
|
jellyfinServerID: string;
|
|
errored: boolean;
|
|
owner: string;
|
|
url: string;
|
|
}
|
|
|
|
export const getServerList = async (): Promise<Array<Server>> => {
|
|
console.log("fetching server list");
|
|
const response = await axios.get<Array<Server>>(`${apiUrl}/servers/all`, { withCredentials: true });
|
|
|
|
console.log(response);
|
|
|
|
return response.data;
|
|
} |