Skip to content

feat(admin): paginate audit logs - #1241

Merged
mftee merged 1 commit into
CodeGirlsInc:mainfrom
lovesmilesmall-hue:feat/issue-1177-audit-log-pagination
Aug 26, 2026
Merged

feat(admin): paginate audit logs#1241
mftee merged 1 commit into
CodeGirlsInc:mainfrom
lovesmilesmall-hue:feat/issue-1177-audit-log-pagination

Conversation

@lovesmilesmall-hue

@lovesmilesmall-hue lovesmilesmall-hue commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #1177
Closes #1174
Closes #1175
Closes #1176

Replaces hard-coded audit-log rows with the existing paginated GET /admin/access-logs contract and limits each request to 20 records. The page now passes the documented filters, renders truthful loading/error/empty states, and exposes previous/next controls only when the backend reports multiple pages.

Why

The audit-log page previously rendered fabricated rows and had no bound on DOM growth, despite the backend already providing page, limit, total, and totalPages. Using that existing endpoint and contract prevents the browser from rendering the full access-log history at once and avoids presenting sample data as production audit data.

What was built

File What it contains
frontend/app/(protected)/admin/audit-logs/page.tsx Client-side access-log fetch, fixed page-size request, user/date filters, loading/error/empty states, and bounded pagination controls.
frontend/test-utils/admin-audit-logs.test.tsx Verifies the limit=20 request, bounded first-page rendering, pagination visibility, and loading the next bounded page.

Integration changes outside frontend/app/(protected)/admin/audit-logs/

No unrelated files modified. The page's previous mock data and server-only implementation were replaced because they could not satisfy the production pagination acceptance criterion.

Acceptance criteria coverage

  • The audit-logs table renders a bounded page size regardless of total record count (frontend/app/(protected)/admin/audit-logs/page.tsx — fixed PAGE_SIZE = 20, API limit=20, and page-only rendering; frontend/test-utils/admin-audit-logs.test.tsx — 20-row bound and next-page request)

Deliberately deferred

None.

Test plan

  • npm test — not run per request
  • npm run typecheck — not run per request
  • npm run lint — not run per request
  • npm run build — not run per request
  • Formatter — not run per request

Env vars / Notes

No new environment variables or public API surfaces. The page uses the existing NEXT_PUBLIC_API_URL convention and the existing backend endpoint documented in frontend/app/(protected)/admin/audit-logs/README.md.

@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

@lovesmilesmall-hue is attempting to deploy a commit to the Mftee's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@lovesmilesmall-hue Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@mftee mftee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No merge conflicts with main. Audit log pagination looks good - approving.

@mftee
mftee merged commit 68d6f4b into CodeGirlsInc:main Aug 26, 2026
0 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants