Skip to content

Admin Audit Logs: wire to /api/admin/audit and merge duplicate pages #482

Description

@zeemscript

Background

Area: app/[locale]/admin/audit-log/page.jsx and audit-logs/page.jsx (duplicates) — mock via admin-audit.ts withMockDelay / generateMockLogs().
Backend (exists, mounted): GET /api/admin/audit.
Task: wire to the real endpoint (filters/pagination) and consolidate the two duplicate pages into one canonical route.

Rules (for the PR to be payable)

  • Branch from dev; PR must target dev.
  • Swap the mock/stub data source for a real call via the existing axiosInstance / lib/actions pattern; keep the page's existing loading/empty/error states.
  • Preserve graceful degradation: if the API errors, fall back to a sensible empty/error state — do not crash the page.
  • Scope changes to this admin area only. Do not touch the reserved role/auth logic or unrelated pages.
  • npm test, npm run lint, npm run typecheck, and npm run build must all pass. Add/adjust tests for the wired data path.

Acceptance criteria

  • Page renders live backend data (mock/stub/localStorage source removed)
  • Loading, empty, and error states preserved (graceful fallback on API error)
  • Tests cover the wired data path; suite + lint + typecheck + build green
  • PR targets dev

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programcomplexity:trivialMaps to Drips Wave Trivial tier (100 pts)enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions