Update customFetch implementation in API constants to accept RequestInfo and RequestInit types for improved type safety
This commit is contained in:
@@ -7,7 +7,7 @@ export const DEFAULT_CONFIG: Required<ApiClientConfig> = {
|
|||||||
timeout: 30000, // 30 seconds
|
timeout: 30000, // 30 seconds
|
||||||
retries: 1,
|
retries: 1,
|
||||||
retryDelay: 1000, // 1 second
|
retryDelay: 1000, // 1 second
|
||||||
customFetch: fetch,
|
customFetch: (input: RequestInfo | URL, init?: RequestInit) => fetch(input, init),
|
||||||
onAuthError: async () => {
|
onAuthError: async () => {
|
||||||
// Default: redirect to login or refresh token
|
// Default: redirect to login or refresh token
|
||||||
console.warn('Authentication error occurred. Consider redirecting to login.');
|
console.warn('Authentication error occurred. Consider redirecting to login.');
|
||||||
|
|||||||
Reference in New Issue
Block a user