Skip to content

Commit

Permalink
fix wsp overwrite test
Browse files Browse the repository at this point in the history
  • Loading branch information
JaimeSeqLabs committed Sep 27, 2023
1 parent 8febc39 commit 6247dee
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ public class AddCmd extends AbstractWorkspaceCmd {
@Override
protected Response exec() throws ApiException, IOException {

OrgAndWorkspaceDbDto orgWspDto = findOrgAndWorkspaceByName(organizationName, workspaceName);

if (overwrite && orgWspDto.getWorkspaceId() != null){
OrgAndWorkspaceDbDto orgWspDto;
if (overwrite) { // check also wsp existence
orgWspDto = findOrgAndWorkspaceByName(organizationName, workspaceName);
tryDeleteWsp(orgWspDto.getWorkspaceId(), orgWspDto.getOrgId());
} else { // normal 'add'
orgWspDto = organizationByName(organizationName);
}

Workspace workspace = new Workspace();
Expand Down

0 comments on commit 6247dee

Please sign in to comment.