@@ -22,7 +22,7 @@ export async function getManagedWorkspaces(
22
22
23
23
try {
24
24
const res = await axios . get ( `/api/plugins/enterprise/org/list` ) ;
25
- const all : ManagedOrg [ ] = res . data ;
25
+ const all : ManagedOrg [ ] = res . data . data ;
26
26
return all . filter ( org => org . environmentId === environmentId ) ;
27
27
} catch ( err ) {
28
28
const errorMsg = err instanceof Error ? err . message : "Failed to fetch managed workspaces" ;
@@ -100,7 +100,7 @@ export async function unconnectManagedWorkspace(orgGid: string) {
100
100
101
101
export async function getManagedApps ( environmentId : string ) {
102
102
const res = await axios . get ( `/api/plugins/enterprise/app/list` ) ;
103
- const allApps = res . data ;
103
+ const allApps = res . data . data ;
104
104
return allApps . filter ( ( app : any ) => app . environmentId === environmentId ) ;
105
105
}
106
106
@@ -149,7 +149,7 @@ export const getManagedDataSources = async (environmentId: string): Promise<any[
149
149
const response = await axios . get (
150
150
`/api/plugins/enterprise/datasource/list?environmentId=${ environmentId } `
151
151
) ;
152
- return response . data || [ ] ;
152
+ return response . data . data || [ ] ;
153
153
} catch ( error ) {
154
154
console . error ( "Error fetching managed data sources:" , error ) ;
155
155
throw error ;
@@ -204,14 +204,15 @@ export async function getManagedQueries(environmentId: string): Promise<Query[]>
204
204
environmentId
205
205
}
206
206
} ) ;
207
+ console . log ( "Managed queries response function:" , response . data ) ;
207
208
208
- if ( ! response . data || ! Array . isArray ( response . data ) ) {
209
+ if ( ! response . data . data || ! Array . isArray ( response . data . data ) ) {
209
210
return [ ] ;
210
211
}
211
212
212
213
// Map the response to match our Query interface
213
214
// Note: You may need to adjust this mapping based on the actual response structure
214
- return response . data . map ( ( item : any ) => ( {
215
+ return response . data . data . map ( ( item : any ) => ( {
215
216
id : item . id || item . qlQueryId ,
216
217
gid : item . qlQueryGid ,
217
218
name : item . qlQueryName ,
0 commit comments