Add completion and answered marking
This commit is contained in:
13
functions/api/events-team/events/[id]/complete.ts
Normal file
13
functions/api/events-team/events/[id]/complete.ts
Normal file
@ -0,0 +1,13 @@
|
||||
export async function onRequestPost(context: RequestContext) {
|
||||
const id = context.params.id as string;
|
||||
|
||||
await context.env.D1.prepare(
|
||||
"UPDATE events SET performed_at = ? WHERE id = ?;",
|
||||
)
|
||||
.bind(Date.now(), id)
|
||||
.run();
|
||||
|
||||
return new Response(null, {
|
||||
status: 204,
|
||||
});
|
||||
}
|
11
functions/api/events-team/events/[id]/solve.ts
Normal file
11
functions/api/events-team/events/[id]/solve.ts
Normal file
@ -0,0 +1,11 @@
|
||||
export async function onRequestPost(context: RequestContext) {
|
||||
await context.env.D1.prepare(
|
||||
"UPDATE events SET answered_at = ? WHERE id = ?;",
|
||||
)
|
||||
.bind(Date.now(), context.params.id)
|
||||
.run();
|
||||
|
||||
return new Response(null, {
|
||||
status: 204,
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user