Skip to content

Commit 175f3b1

Browse files
committed
Remove requirement of editor
1 parent 6e5d225 commit 175f3b1

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

components/dashboard/src/service/json-rpc-workspace-client.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,6 @@ export class JsonRpcWorkspaceClient implements PromiseClient<typeof WorkspaceSer
138138
if (!request.metadata || !request.metadata.organizationId || !uuidValidate(request.metadata.organizationId)) {
139139
throw new ApplicationError(ErrorCodes.BAD_REQUEST, "organizationId is required");
140140
}
141-
if (!request.source.value.editor?.name) {
142-
throw new ApplicationError(ErrorCodes.BAD_REQUEST, "editor is required");
143-
}
144141
if (!request.source.value.url) {
145142
throw new ApplicationError(ErrorCodes.BAD_REQUEST, "source is required");
146143
}
@@ -152,8 +149,10 @@ export class JsonRpcWorkspaceClient implements PromiseClient<typeof WorkspaceSer
152149
workspaceClass: request.source.value.workspaceClass,
153150
projectId: request.metadata.configurationId,
154151
ideSettings: {
155-
defaultIde: request.source.value.editor.name,
156-
useLatestVersion: request.source.value.editor.version === "latest",
152+
defaultIde: request.source.value.editor?.name,
153+
useLatestVersion: request.source.value.editor?.version
154+
? request.source.value.editor?.version === "latest"
155+
: undefined,
157156
},
158157
});
159158
const workspace = await this.getWorkspace({ workspaceId: response.createdWorkspaceId });

components/server/src/api/workspace-service-api.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,6 @@ export class WorkspaceServiceAPI implements ServiceImpl<typeof WorkspaceServiceI
124124
if (!req.source.value || !req.source.value.url) {
125125
throw new ApplicationError(ErrorCodes.BAD_REQUEST, "source is required");
126126
}
127-
if (!req.source.value.editor?.name) {
128-
throw new ApplicationError(ErrorCodes.BAD_REQUEST, "editor is required");
129-
}
130127
const contextUrl = req.source.value;
131128
const user = await this.userService.findUserById(ctxUserId(), ctxUserId());
132129
const { context, project } = await this.contextService.parseContext(user, contextUrl.url, {
@@ -149,8 +146,10 @@ export class WorkspaceServiceAPI implements ServiceImpl<typeof WorkspaceServiceI
149146
forceDefaultImage: req.forceDefaultConfig,
150147
workspaceClass: contextUrl.workspaceClass,
151148
ideSettings: {
152-
defaultIde: req.source.value.editor.name,
153-
useLatestVersion: req.source.value.editor.version === "latest",
149+
defaultIde: req.source.value.editor?.name,
150+
useLatestVersion: req.source.value.editor?.version
151+
? req.source.value.editor?.version === "latest"
152+
: undefined,
154153
},
155154
clientRegionCode: ctxClientRegion(),
156155
});

0 commit comments

Comments
 (0)