New Dashboard
This commit is contained in:
@@ -27,6 +27,7 @@ import {z} from "zod";
|
||||
import {fetchWithToken, tokenStore} from "@repo/repo.ts";
|
||||
import {pageRepo} from "@repo/page.ts";
|
||||
import {dataRepo} from "@repo/data.ts";
|
||||
import {permsRepo} from "@repo/perms.ts";
|
||||
|
||||
export const schemTypes = cached<SchematicType[]>([], () =>
|
||||
fetchWithToken(get(tokenStore), "/data/admin/schematicTypes")
|
||||
@@ -37,6 +38,13 @@ export const players = cached<Player[]>([], async () => {
|
||||
return z.array(PlayerSchema).parse(await res.json());
|
||||
});
|
||||
|
||||
export const permissions = cached({
|
||||
perms: [],
|
||||
prefixes: {},
|
||||
}, async () => {
|
||||
return get(permsRepo).listPerms();
|
||||
});
|
||||
|
||||
export const gamemodes = cached<string[]>([], async () => {
|
||||
const res = await fetchWithToken(get(tokenStore), "/data/admin/gamemodes");
|
||||
return z.array(z.string()).parse(await res.json());
|
||||
|
||||
Reference in New Issue
Block a user