Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit21a74e2

Browse files
committed
Fix environments response for new plugin
1 parent1ec6c93 commit21a74e2

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export async function getManagedWorkspaces(
2222

2323
try{
2424
constres=awaitaxios.get(`/api/plugins/enterprise/org/list`);
25-
constall:ManagedOrg[]=res.data;
25+
constall:ManagedOrg[]=res.data.data;
2626
returnall.filter(org=>org.environmentId===environmentId);
2727
}catch(err){
2828
consterrorMsg=errinstanceofError ?err.message :"Failed to fetch managed workspaces";
@@ -100,7 +100,7 @@ export async function unconnectManagedWorkspace(orgGid: string) {
100100

101101
exportasyncfunctiongetManagedApps(environmentId:string){
102102
constres=awaitaxios.get(`/api/plugins/enterprise/app/list`);
103-
constallApps=res.data;
103+
constallApps=res.data.data;
104104
returnallApps.filter((app:any)=>app.environmentId===environmentId);
105105
}
106106

@@ -149,7 +149,7 @@ export const getManagedDataSources = async (environmentId: string): Promise<any[
149149
constresponse=awaitaxios.get(
150150
`/api/plugins/enterprise/datasource/list?environmentId=${environmentId}`
151151
);
152-
returnresponse.data||[];
152+
returnresponse.data.data||[];
153153
}catch(error){
154154
console.error("Error fetching managed data sources:",error);
155155
throwerror;
@@ -204,14 +204,15 @@ export async function getManagedQueries(environmentId: string): Promise<Query[]>
204204
environmentId
205205
}
206206
});
207+
console.log("Managed queries response function:",response.data);
207208

208-
if(!response.data||!Array.isArray(response.data)){
209+
if(!response.data.data||!Array.isArray(response.data.data)){
209210
return[];
210211
}
211212

212213
// Map the response to match our Query interface
213214
// Note: You may need to adjust this mapping based on the actual response structure
214-
returnresponse.data.map((item:any)=>({
215+
returnresponse.data.data.map((item:any)=>({
215216
id:item.id||item.qlQueryId,
216217
gid:item.qlQueryGid,
217218
name:item.qlQueryName,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export async function getEnvironments(): Promise<Environment[]> {
5858
);
5959

6060
// Return the data array directly from response.data
61-
returnresponse.data||[];
61+
returnresponse.data.data||[];
6262
}catch(error){
6363
consterrorMessage=
6464
errorinstanceofError ?error.message :"Failed to fetch environments";
@@ -82,7 +82,7 @@ export async function getEnvironmentById(id: string): Promise<Environment> {
8282
thrownewError("Failed to fetch environment");
8383
}
8484

85-
returnresponse.data;
85+
returnresponse.data.data;
8686
}catch(error){
8787
consterrorMessage=
8888
errorinstanceofError ?error.message :"Failed to fetch environment";

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp