Skip to content

Commit

Permalink
also handle promot environment delete
Browse files Browse the repository at this point in the history
  • Loading branch information
Schnitzel committed Jan 23, 2019
1 parent d5da69a commit 096fc0f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions services/api/src/resources/environment/resolvers.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ const deleteEnvironment = async (

switch (environment.deployType) {
case 'branch':
case 'promote':
data = {
...data,
branch: name,
Expand All @@ -558,14 +559,14 @@ const deleteEnvironment = async (

default:
sendToLagoonLogs('error', data.projectName, '', 'api:deleteEnvironment:error', meta,
`*[${data.projectName}]* Unknown deploy type ${environment.deployType} \`${environment.name}\``
`*[${data.projectName}]* Unknown deploy type ${environment.deployType} \`${environment.name}\``,
);
return `Error: unknown deploy type ${environment.deployType}`;
}

await createRemoveTask(data);
sendToLagoonLogs('info', data.projectName, '', 'api:deleteEnvironment', meta,
`*[${data.projectName}]* Deleting environment \`${environment.name}\``
`*[${data.projectName}]* Deleting environment \`${environment.name}\``,
);

return 'success';
Expand Down

0 comments on commit 096fc0f

Please sign in to comment.