Skip to content

Feat: Axios client, TanStack Query & GDPR endpoints#861

Merged
mftee merged 2 commits into
CodeGirlsInc:mainfrom
demilade18-git:demilade18/feat-frontend-gdpr
Jun 28, 2026
Merged

Feat: Axios client, TanStack Query & GDPR endpoints#861
mftee merged 2 commits into
CodeGirlsInc:mainfrom
demilade18-git:demilade18/feat-frontend-gdpr

Conversation

@demilade18-git

@demilade18-git demilade18-git commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Changes

FE-01: Axios API Client with JWT Interceptor (#813)

  • Created lib/api-client.ts with Axios instance pointing to NEXT_PUBLIC_API_URL
  • Request interceptor attaches JWT access token from localStorage
  • Response interceptor silently refreshes token on 401 using /auth/refresh
  • Queues concurrent 401 requests during refresh to avoid race conditions

FE-02: TanStack Query Setup (#814)

  • Created lib/query-provider.tsx with QueryClientProvider (5min stale time, 2 retries)
  • Created lib/query-hooks.ts with typed hooks for auth, documents, organizations, sharing, and admin endpoints
  • Wrapped root layout with QueryProvider

BE-87: GDPR Data Export (#811)

  • GET /api/users/me/export returns user profile (minus secrets), documents, and verification records as JSON

BE-88: GDPR Account Erasure (#812)

  • DELETE /api/users/me/data anonymizes personal data (email, name, password hash) while preserving record integrity

Testing Notes

  • Frontend: verify localStorage token attachment and 401 refresh flow
  • Backend GDPR: call endpoints with valid JWT and inspect response

Closes #813
Closes #814
Closes #811
Closes #812

- Set up axios API client with JWT auth interceptor and silent refresh on 401 (CodeGirlsInc#813)
- Set up TanStack Query provider and hooks for API data fetching (CodeGirlsInc#814)
- Implement GET /api/users/me/export for GDPR data export (CodeGirlsInc#811)
- Implement DELETE /api/users/me/data for GDPR account erasure (CodeGirlsInc#812)

Closes CodeGirlsInc#813, CodeGirlsInc#814, CodeGirlsInc#811, CodeGirlsInc#812
@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

@demilade18-git 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 Jun 28, 2026

Copy link
Copy Markdown

@demilade18-git 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 merged commit a144685 into CodeGirlsInc:main Jun 28, 2026
2 of 5 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