Add body parsing for member delete endpoint
This commit is contained in:
parent
a2a7aa716f
commit
0f6cfb947c
@ -1,7 +1,15 @@
|
|||||||
import { jsonError } from "../../../common.js";
|
import { jsonError } from "../../../common.js";
|
||||||
|
|
||||||
export async function onRequestDelete(context: RequestContext) {
|
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 (
|
if (
|
||||||
typeof id !== "string" ||
|
typeof id !== "string" ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user