Only check for events not denied yet on /new endpoint

This commit is contained in:
Regalijan 2024-02-15 13:09:44 -05:00
parent 98b191167b
commit 69f407142d
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

@ -23,7 +23,7 @@ export async function onRequestPost(context: RequestContext) {
if (
await context.env.D1.prepare(
"SELECT * FROM events WHERE day = ? AND month = ? AND type = ? AND year = ?;",
"SELECT * FROM events WHERE approved = false AND day = ? AND month = ? AND type = ? AND year = ?;",
)
.bind(day, currentMonth, type, currentYear)
.first()