@@ -16,19 +16,19 @@ import toast from 'react-hot-toast'
1616import { cryptoManager } from '@crypto/cryptoManager'
1717
1818// Types
19- export interface ApiResponse < T = any > {
19+ export interface ApiResponse < T = unknown > {
2020 success : boolean
2121 data ?: T
2222 message ?: string
2323 error ?: string
24- details ?: any
24+ details ?: unknown
2525}
2626
2727export interface ApiError {
2828 message : string
2929 status : number
3030 code ?: string
31- details ?: any
31+ details ?: unknown
3232}
3333
3434export interface RequestConfig extends AxiosRequestConfig {
@@ -162,7 +162,7 @@ class ApiClient {
162162 return this . refreshPromise
163163 }
164164
165- this . refreshPromise = new Promise ( async ( resolve , reject ) => {
165+ this . refreshPromise = new Promise ( ( resolve , reject ) => { ( async ( ) => {
166166 try {
167167 // Get refresh token from localStorage or store
168168 const storedAuth = localStorage . getItem ( 'turning-wheel-auth' )
@@ -204,8 +204,7 @@ class ApiClient {
204204 reject ( error )
205205 } finally {
206206 this . refreshPromise = null
207- }
208- } )
207+ } } ) ( ) } )
209208
210209 return this . refreshPromise
211210 }
@@ -260,42 +259,42 @@ class ApiClient {
260259 /**
261260 * GET request
262261 */
263- async get < T > ( url : string , config ?: RequestConfig ) : Promise < AxiosResponse < ApiResponse < T > > > {
262+ get < T > ( url : string , config ?: RequestConfig ) : Promise < AxiosResponse < ApiResponse < T > > > {
264263 return this . instance . get ( url , config )
265264 }
266265
267266 /**
268267 * POST request
269268 */
270- async post < T > ( url : string , data ?: any , config ?: RequestConfig ) : Promise < AxiosResponse < ApiResponse < T > > > {
269+ post < T > ( url : string , data ?: unknown , config ?: RequestConfig ) : Promise < AxiosResponse < ApiResponse < T > > > {
271270 return this . instance . post ( url , data , config )
272271 }
273272
274273 /**
275274 * PUT request
276275 */
277- async put < T > ( url : string , data ?: any , config ?: RequestConfig ) : Promise < AxiosResponse < ApiResponse < T > > > {
276+ put < T > ( url : string , data ?: unknown , config ?: RequestConfig ) : Promise < AxiosResponse < ApiResponse < T > > > {
278277 return this . instance . put ( url , data , config )
279278 }
280279
281280 /**
282281 * PATCH request
283282 */
284- async patch < T > ( url : string , data ?: any , config ?: RequestConfig ) : Promise < AxiosResponse < ApiResponse < T > > > {
283+ patch < T > ( url : string , data ?: unknown , config ?: RequestConfig ) : Promise < AxiosResponse < ApiResponse < T > > > {
285284 return this . instance . patch ( url , data , config )
286285 }
287286
288287 /**
289288 * DELETE request
290289 */
291- async delete < T > ( url : string , config ?: RequestConfig ) : Promise < AxiosResponse < ApiResponse < T > > > {
290+ delete < T > ( url : string , config ?: RequestConfig ) : Promise < AxiosResponse < ApiResponse < T > > > {
292291 return this . instance . delete ( url , config )
293292 }
294293
295294 /**
296295 * Upload file with progress tracking
297296 */
298- async uploadFile < T > (
297+ uploadFile < T > (
299298 url : string ,
300299 file : File ,
301300 onProgress ?: ( progress : number ) => void ,
@@ -354,10 +353,10 @@ class ApiClient {
354353 /**
355354 * Make encrypted request
356355 */
357- async encryptedRequest < T > (
356+ encryptedRequest < T > (
358357 method : 'get' | 'post' | 'put' | 'patch' | 'delete' ,
359358 url : string ,
360- data ?: any ,
359+ data ?: unknown ,
361360 config ?: RequestConfig
362361 ) : Promise < AxiosResponse < ApiResponse < T > > > {
363362 const encryptedConfig : RequestConfig = {
@@ -397,7 +396,7 @@ class ApiClient {
397396 /**
398397 * Get current user
399398 */
400- async getCurrentUser ( ) : Promise < AxiosResponse < ApiResponse < any > > > {
399+ getCurrentUser ( ) : Promise < AxiosResponse < ApiResponse < any > > > {
401400 return this . get ( '/auth/me' )
402401 }
403402
0 commit comments