New Code Editor and fun

This commit is contained in:
2023-12-03 19:31:29 +01:00
parent 2abe554059
commit fbd52f3edb
53 changed files with 1330 additions and 489 deletions

View File

@ -6,10 +6,10 @@ 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));
return await fetchWithToken(this.token, "/data/server").then(value => value.json()).then(ServerSchema.parse);
}
public async getMe(): Promise<Player> {
return await fetchWithToken(this.token, "/data/me").then(value => value.json()).then(value => PlayerSchema.parse(value));
return await fetchWithToken(this.token, "/data/me").then(value => value.json()).then(PlayerSchema.parse);
}
}