diff --git a/functions/api/game-bans/[user]/save-data.ts b/functions/api/game-bans/[user]/save-data.ts new file mode 100644 index 0000000..5ee0556 --- /dev/null +++ b/functions/api/game-bans/[user]/save-data.ts @@ -0,0 +1,14 @@ +import { jsonError, jsonResponse } from "../../../common.js"; +import { getSaveData } from "../../../roblox-open-cloud.js"; + +export async function onRequestGet(context: RequestContext) { + const id = parseInt(context.params.id as string); + + if (isNaN(id)) return jsonError("ID must be a number", 400); + + try { + return jsonResponse(JSON.stringify(await getSaveData(context, id))); + } catch { + return jsonError("Failed to retrieve save data", 500); + } +}