refactor: implement audit fetch trigger in OrganizationSettings to enhance data loading efficiency and improve filter responsiveness

This commit is contained in:
Usman Baig
2026-02-05 14:32:33 +01:00
parent e581d5212f
commit de22c2da63
3 changed files with 11 additions and 35 deletions

View File

@@ -68,7 +68,11 @@ async function apiRequest<T>(
// * Determine base URL
const isAuthRequest = endpoint.startsWith('/auth')
const baseUrl = isAuthRequest ? AUTH_API_URL : API_URL
const url = `${baseUrl}/api/v1${endpoint}`
// * Handle legacy endpoints that already include /api/ prefix
const url = endpoint.startsWith('/api/')
? `${baseUrl}${endpoint}`
: `${baseUrl}/api/v1${endpoint}`
const headers: HeadersInit = {
'Content-Type': 'application/json',