diff --git a/app/routes/events-team_.report.tsx b/app/routes/events-team_.report.tsx index 1dbe8c8..da37eae 100644 --- a/app/routes/events-team_.report.tsx +++ b/app/routes/events-team_.report.tsx @@ -38,7 +38,7 @@ export async function loader({ context }: { context: RequestContext }) { "SELECT id, name, roblox_id FROM et_members;", ).all(); const eventsQuery = await context.env.D1.prepare( - "SELECT answered_at, created_by, performed_at, reached_minimum_player_count, type FROM events WHERE month = ? AND year = ?;", + "SELECT approved, answered_at, created_by, performed_at, reached_minimum_player_count, type FROM events WHERE month = ? AND year = ?;", ) .bind(month, year) .all(); @@ -52,13 +52,14 @@ export async function loader({ context }: { context: RequestContext }) { ); for (const event of eventsQuery.results as { + approved: number; answered_at: number; created_by: string; performed_at: number; reached_minimum_player_count: number; type: string; }[]) { - if (!memberMap[event.created_by]) continue; + if (!memberMap[event.created_by] || !event.approved) continue; if (event.performed_at) memberMap[event.created_by].points += 10; else memberMap[event.created_by].points -= 10;