feat: integrate real backend API with centralized API client

- Add centralized apiPost() client (src/services/api.ts) that handles
  auth injection, error handling, and token expiry uniformly
- Implement real authentication against /accounts/api/login/ and /logout/
- Rewrite partnerApi and userAppApi to use centralized client
- Connect Partners page to /partner/list/ and /partner/create/ APIs
- Add Vite proxy rules for /accounts/api and /partner endpoints
- Update AuthUser type to match full backend user response
- Move NuqsAdapter inside BrowserRouter for correct routing context

Made-with: Cursor
This commit is contained in:
Vivek P Prakash
2026-03-15 00:25:55 +05:30
parent 457004a0ef
commit 9cff4344d0
12 changed files with 470 additions and 637 deletions

View File

@@ -12,12 +12,20 @@ export default defineConfig(({ mode }) => ({
overlay: false,
},
proxy: {
// Proxy API requests to bypass CORS during development
'/accounts/api': {
target: 'http://0.0.0.0:8000',
changeOrigin: true,
secure: false,
},
'/partner': {
target: 'http://0.0.0.0:8000',
changeOrigin: true,
secure: false,
},
'/api': {
target: 'https://uat.eventifyplus.com',
changeOrigin: true,
secure: false,
rewrite: (path) => path,
},
},
},