Skip to content

Commit d989983

Browse files
committed
fix(events): Improve event status display and filtering in admin events page
- Capitalize first letter of event status in admin events table - Update admin events API to filter out draft events - Modify event query to only show events with specific approval statuses - Enhance readability of event status display in table view
1 parent 6df616e commit d989983

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

app/admin/events/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ export default function AdminEvents() {
360360
</TableCell>
361361
<TableCell>
362362
<Badge variant="outline">
363-
{event.status}
363+
{event.status.charAt(0).toUpperCase() + event.status.slice(1)}
364364
</Badge>
365365
</TableCell>
366366
<TableCell>

app/api/admin/events/route.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@ export async function GET(request: NextRequest) {
4343

4444
const serviceSupabase = createServiceClient(supabaseUrl, supabaseServiceKey)
4545

46+
// Only show events that need moderation (pending, approved, rejected)
47+
// Exclude drafts as they haven't been submitted for review yet
4648
const { data: events, error } = await serviceSupabase
4749
.from('events')
4850
.select('*')
51+
.in('approval_status', ['pending', 'approved', 'rejected'])
4952
.order('created_at', { ascending: false })
5053
.range(offset, offset + limit - 1)
5154

0 commit comments

Comments
 (0)