15 lines
461 B
TypeScript

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);
}
}