Add completion and answered marking

This commit is contained in:
2024-03-05 17:42:38 -05:00
parent ff61311e7c
commit a4c8781f9d
3 changed files with 190 additions and 12 deletions

View 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,
});
}

View 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,
});
}