17 lines
438 B
TypeScript
17 lines
438 B
TypeScript
import { jsonError } from "../../../../common.js";
|
|
|
|
export async function onRequestPost(context: RequestContext) {
|
|
if (context.data.event.reached_minimum_player_count)
|
|
return jsonError("This event is already certified", 400);
|
|
|
|
await context.env.D1.prepare(
|
|
"UPDATE events SET reached_minimum_player_count WHERE id = ?;",
|
|
)
|
|
.bind(context.data.event.id)
|
|
.run();
|
|
|
|
return new Response(null, {
|
|
status: 204,
|
|
});
|
|
}
|