Move to V2 datastore apis

This commit is contained in:
2026-03-31 03:24:13 -04:00
parent b69b5cb4eb
commit e3af1e4f37
8 changed files with 36 additions and 53 deletions

View File

@@ -33,13 +33,7 @@ export async function onRequestGet(context: RequestContext) {
let banList;
try {
banList = (await getBanList(context)) as {
[k: number]: {
BanType: number;
hidden_from_leaderboards?: boolean;
serverconfigurator_blacklist?: boolean;
};
};
banList = (await getBanList(context)).value;
} catch (e) {
console.log(e);

View File

@@ -31,12 +31,10 @@ export async function onRequestPost(context: RequestContext) {
)
.run();
const banList = (await getBanList(context)) as {
[k: string]: { BanType: number };
};
const { etag, path, value: banList } = await getBanList(context);
delete banList[user];
await setBanList(context, banList);
await setBanList(context, banList, etag);
return new Response(null, {
status: 204,