diff --git a/functions/api/events-team/team-members/user.ts b/functions/api/events-team/team-members/user.ts index 2c221e4..0adcc04 100644 --- a/functions/api/events-team/team-members/user.ts +++ b/functions/api/events-team/team-members/user.ts @@ -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" ||