Skip to content

Commit 8c11ef5

Browse files
committed
fix data source error
1 parent f5987e2 commit 8c11ef5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

client/packages/lowcoder/src/pages/setting/environments/services/environments.service.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,19 +315,20 @@ export async function getWorkspaceDataSources(
315315
};
316316

317317
// Make the API request to get data sources
318-
const response = await axios.get<DataSourceWithMeta[]>(`${apiServiceUrl}/api/datasources/listByOrg`, {
318+
const response = await axios.get<{data:DataSourceWithMeta[]}>(`${apiServiceUrl}/api/datasources/listByOrg`, {
319319
headers,
320320
params: {
321321
orgId: workspaceId
322322
}
323323
});
324-
324+
console.log("data source response",response);
325+
325326
// Check if response is valid
326327
if (!response.data) {
327328
return [];
328329
}
329330

330-
return response.data;
331+
return response.data.data ;
331332
} catch (error) {
332333
// Handle and transform error
333334
const errorMessage = error instanceof Error ? error.message : 'Failed to fetch data sources';

0 commit comments

Comments
 (0)