Skip to content

Commit 2b4a718

Browse files
committed
setup for new managed-obj endpoint
1 parent 4b9f37d commit 2b4a718

File tree

5 files changed

+11
-21
lines changed

5 files changed

+11
-21
lines changed

client/packages/lowcoder/src/pages/setting/environments/components/AppsTab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const AppsTab: React.FC<AppsTabProps> = ({ environment, workspaceId }) => {
8787
app.applicationGid,
8888
environment.environmentId,
8989
ManagedObjectType.APP,
90-
app.name
90+
9191
);
9292
} else {
9393
await unsetManagedObject(

client/packages/lowcoder/src/pages/setting/environments/components/DataSourcesTab.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ const DataSourcesTab: React.FC<DataSourcesTabProps> = ({ environment, workspaceI
8585
dataSource.gid,
8686
environment.environmentId,
8787
ManagedObjectType.DATASOURCE,
88-
dataSource.name
8988
);
9089
} else {
9190
await unsetManagedObject(

client/packages/lowcoder/src/pages/setting/environments/components/QueriesTab.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ const QueriesTab: React.FC<QueriesTabProps> = ({ environment, workspaceId }) =>
8686
query.gid,
8787
environment.environmentId,
8888
ManagedObjectType.QUERY,
89-
query.name
9089
);
9190
} else {
9291
await unsetManagedObject(

client/packages/lowcoder/src/pages/setting/environments/context/WorkspaceContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ import React, {
118118
workspace.gid!,
119119
environment.environmentId,
120120
ManagedObjectType.ORG,
121-
workspace.name
121+
122122

123123
);
124124
} else {

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

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,29 +59,20 @@ export async function isManagedObject(
5959
export async function setManagedObject(
6060
objGid: string,
6161
environmentId: string,
62-
objType: ManagedObjectType,
63-
objName?: string,
64-
objTags: string[] = []
62+
objType: ManagedObjectType
6563
): Promise<boolean> {
6664
try {
6765
if (!objGid || !environmentId || !objType) {
6866
throw new Error("Missing required parameters");
6967
}
7068

71-
const response = await axios.post(`/api/plugins/enterprise/managed-obj`,
72-
// Include optional parameters in the request body instead of query params
73-
{
74-
objName,
75-
objTags: objTags.length > 0 ? objTags : undefined
76-
},
77-
{
78-
params: {
79-
objGid,
80-
environmentId,
81-
objType
82-
}
83-
}
84-
);
69+
const requestBody = {
70+
objGid,
71+
environmentId,
72+
objType
73+
};
74+
75+
const response = await axios.post(`/api/plugins/enterprise/managed-obj`, requestBody);
8576

8677
return response.status === 200;
8778
} catch (error) {
@@ -91,6 +82,7 @@ export async function setManagedObject(
9182
}
9283
}
9384

85+
9486
/**
9587
* Set an object as unmanaged
9688
* @param objGid - Object's global ID

0 commit comments

Comments
 (0)