Skip to content

Commit 9c7c221

Browse files
committed
update workspace endpoint for new plugin
1 parent aeb9b0b commit 9c7c221

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

client/packages/lowcoder/src/pages/setting/environments/config/workspace.config.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,20 +159,17 @@ export const workspaceConfig: DeployableItemConfig<Workspace, WorkspaceStats> =
159159
// Deploy configuration
160160
deploy: {
161161
enabled: true,
162-
fields: [
163-
{
164-
name: 'updateDependenciesIfNeeded',
165-
label: 'Update Dependencies If Needed',
166-
type: 'checkbox',
167-
defaultValue: false
168-
}
169-
],
162+
fields: [],
170163
prepareParams: (item: Workspace, values: any, sourceEnv: Environment, targetEnv: Environment) => {
164+
if (!item.gid) {
165+
console.error('Missing workspace.gid when deploying workspace:', item);
166+
}
167+
console.log('item.gid', item.gid);
168+
171169
return {
172170
envId: sourceEnv.environmentId,
173171
targetEnvId: targetEnv.environmentId,
174-
workspaceId: item.id,
175-
updateDependenciesIfNeeded: values.updateDependenciesIfNeeded
172+
workspaceId: item.gid
176173
};
177174
},
178175
execute: (params: any) => deployWorkspace(params)

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,20 @@ export async function deployWorkspace(params: {
8585
envId: string;
8686
targetEnvId: string;
8787
workspaceId: string;
88-
updateDependenciesIfNeeded?: boolean;
8988
}): Promise<boolean> {
9089
try {
91-
const response = await axios.post('/api/plugins/enterprise/deploy', params);
90+
// Use the new endpoint format with only essential parameters
91+
const response = await axios.post('/api/plugins/enterprise/org/deploy', null, {
92+
params: {
93+
orgGid: params.workspaceId, // Using workspaceId as orgGid
94+
envId: params.envId,
95+
targetEnvId: params.targetEnvId
96+
}
97+
});
9298
return response.status === 200;
9399
} catch (error) {
94100
const errorMessage = error instanceof Error ? error.message : 'Failed to deploy workspace';
95-
message.error(errorMessage);
96-
throw error;
101+
// Don't show message directly, let the calling component handle it
102+
throw new Error(errorMessage);
97103
}
98104
}

0 commit comments

Comments
 (0)