File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -188,16 +188,14 @@ export async function queryApiText(
188188) : Promise < CResult < string > > {
189189 const opts = { __proto__ : null , throws : false , ...options }
190190 try {
191- const result = await sdk . getApi < CResult < string > > ( path , {
191+ // SDK 1.9.0+ returns data directly when throws: true, or result object when throws: false.
192+ // Always throw on error, we'll wrap in CResult.
193+ const result = await sdk . getApi < string > ( path , {
192194 responseType : 'text' ,
193- throws : opts . throws ,
195+ throws : true ,
194196 } )
195197
196- if ( result && typeof result === 'object' && 'ok' in result ) {
197- return result as CResult < string >
198- }
199-
200- // SDK returned direct string when throws: true succeeds.
198+ // Wrap in CResult for backward compatibility
201199 return { ok : true , data : result as string }
202200 } catch ( e ) {
203201 const message = `Error fetching ${ opts . description || 'data' } : ${ e instanceof Error ? e . message : String ( e ) } `
You can’t perform that action at this time.
0 commit comments