Updates and more
This commit is contained in:
11
src/components/repo/data.ts
Normal file
11
src/components/repo/data.ts
Normal file
@ -0,0 +1,11 @@
|
||||
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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user