@@ -126,8 +126,6 @@ function getErrorMessage(statusText: string, data: unknown): string {
126126 return `API Error: ${ statusText } ` ;
127127}
128128
129- // ... (imports)
130-
131129export async function apiCall < T = unknown > (
132130 endpoint : string ,
133131 options : RequestInit = { } ,
@@ -138,12 +136,12 @@ export async function apiCall<T = unknown>(
138136 const shouldQueue = shouldQueueRequest ( options ) ;
139137
140138 if ( shouldQueue && typeof navigator !== 'undefined' && navigator . onLine === false ) {
141- // @ts -ignore
139+ // @ts -expect-error - Bypassing type check for offline action queueing
142140 const action = queueOfflineAction ( endpoint , options ) ;
143141 throw new OfflineActionQueuedError (
144142 'You are offline. This action has been queued and will sync when the connection returns.' ,
145143 endpoint ,
146- // @ts -ignore
144+ // @ts -expect-error - action.id may not be correctly typed in current SDK version
147145 action . id
148146 ) ;
149147 }
@@ -174,12 +172,12 @@ export async function apiCall<T = unknown>(
174172 lastError = normalizeError ( error ) ;
175173
176174 if ( shouldQueue && isLikelyOfflineError ( lastError ) ) {
177- // @ts -ignore
175+ // @ts -expect-error - Bypassing type check for offline action queueing
178176 const action = queueOfflineAction ( endpoint , options ) ;
179177 throw new OfflineActionQueuedError (
180178 'The request was queued because the network is unavailable.' ,
181179 endpoint ,
182- // @ts -ignore
180+ // @ts -expect-error - action.id may not be correctly typed
183181 action . id
184182 ) ;
185183 }
0 commit comments