Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix event deleting
  • Loading branch information
regalijan committed Dec 2, 2024
1 parent a7d5b32 commit dd7577c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions functions/api/events-team/events/[id].ts
Expand Up @@ -7,7 +7,7 @@ export async function onRequestDelete(context: RequestContext) {
[k: string]: number;
} & { created_by: string })
| null = await context.env.D1.prepare(
"SELECT created_by, day, month, year FROM events WHERE id = ?;",
"SELECT created_by, day, month, performed_at, year FROM events WHERE id = ?;",
)
.bind(eventId)
.first();
Expand Down Expand Up @@ -35,7 +35,7 @@ export async function onRequestDelete(context: RequestContext) {
403,
);

if (typeof eventData.performed_at !== "number")
if (typeof eventData.performed_at === "number")
return jsonError(
"Event cannot be deleted because it has already been marked as completed or forgotten",
400,
Expand Down

0 comments on commit dd7577c

Please sign in to comment.