Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add completion and answered marking
- Loading branch information
Showing
3 changed files
with
190 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
}); | ||
} |