Add body parsing for member delete endpoint

This commit is contained in:
Regalijan 2024-02-27 23:36:37 -05:00
parent a2a7aa716f
commit 0f6cfb947c
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

@ -1,7 +1,15 @@
import { jsonError } from "../../../common.js";
export async function onRequestDelete(context: RequestContext) {
const { id } = context.data.body;
let body: { id?: string } = {};
try {
body = await context.request.json();
} catch {
return jsonError("Invalid body", 400);
}
const { id } = body;
if (
typeof id !== "string" ||