Files
Website/src/components/repo/data.ts
2023-11-05 22:27:20 +01:00

11 lines
392 B
TypeScript

import type {Server} from "../types/data.ts";
import {ServerSchema} from "../types/data.ts";
import {fetchWithToken} from "./repo.ts";
export class DataRepo {
constructor(private token: string) {}
public async getServer(): Promise<Server> {
return await fetchWithToken(this.token, "/data/server").then(value => value.json()).then(value => ServerSchema.parse(value));
}
}