Barazo default frontend barazo.forum
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(admin): match moderation log response field name to API (#163)

The API returns { actions: [...] } but the frontend expected { entries: [...] },
causing undefined.map() crash when switching to the Action Log tab.

authored by

Guido X Jansen and committed by
GitHub
f3a291fd 3ac6ef6f

+3 -5
+1 -1
src/hooks/admin/use-moderation-data.ts
··· 67 67 ]) 68 68 setReports(reportsRes.reports) 69 69 setFirstPostQueue(queueRes.items) 70 - setModerationLog(logRes.entries) 70 + setModerationLog(logRes.actions) 71 71 setReportedUsers(usersRes.users) 72 72 setThresholds(thresholdsRes) 73 73 } catch {
+1 -2
src/lib/api/types.ts
··· 463 463 } 464 464 465 465 export interface ModerationLogResponse { 466 - entries: ModerationLogEntry[] 466 + actions: ModerationLogEntry[] 467 467 cursor: string | null 468 - total: number 469 468 } 470 469 471 470 export interface ModerationThresholds {
+1 -2
src/mocks/handlers.ts
··· 455 455 return HttpResponse.json({ error: 'Unauthorized' }, { status: 401 }) 456 456 } 457 457 return HttpResponse.json({ 458 - entries: mockModerationLog, 458 + actions: mockModerationLog, 459 459 cursor: null, 460 - total: mockModerationLog.length, 461 460 }) 462 461 }), 463 462