Don't double-stringify save data

This commit is contained in:
Regalijan 2024-09-05 00:49:03 -04:00
parent ecdd7c4988
commit 31e9935efe
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ export async function onRequestGet(context: RequestContext) {
if (isNaN(id)) return jsonError("ID must be a number", 400); if (isNaN(id)) return jsonError("ID must be a number", 400);
try { try {
return jsonResponse(JSON.stringify(await getSaveData(context, id))); return jsonResponse(await getSaveData(context, id));
} catch { } catch {
return jsonError("Request to Roblox failed", 500); return jsonError("Request to Roblox failed", 500);
} }

View File

@ -19,7 +19,7 @@ export async function getBanList(context: RequestContext) {
return await data.json(); return await data.json();
} }
export async function getSaveData(context: RequestContext, user: number) { export async function getSaveData(context: RequestContext, user: number): Promise<string> {
const data = await fetch(`${SAVE_DATA_URL}${user}`, { const data = await fetch(`${SAVE_DATA_URL}${user}`, {
headers: { headers: {
"x-api-key": context.env.ROBLOX_OPENCLOUD_KEY, "x-api-key": context.env.ROBLOX_OPENCLOUD_KEY,