Remove serverless functions on version archivation (#9535)
Fixes https://github.com/twentyhq/core-team-issues/issues/52 - contrary to title, we do not remove serverless functions on workflow version archivation because serverless fucntion might be used in another workflow version - we fix the serverless funciton version displayed in the code step - we allow test function version in step display right drawer - we delete serverless function only when serverless function has no published version
This commit is contained in:
@ -511,11 +511,16 @@ export class WorkflowVersionStepWorkspaceService {
|
||||
}) {
|
||||
switch (step.type) {
|
||||
case WorkflowActionType.CODE: {
|
||||
await this.serverlessFunctionService.deleteOneServerlessFunction({
|
||||
id: step.settings.input.serverlessFunctionId,
|
||||
workspaceId,
|
||||
});
|
||||
|
||||
if (
|
||||
!(await this.serverlessFunctionService.hasServerlessFunctionPublishedVersion(
|
||||
step.settings.input.serverlessFunctionId,
|
||||
))
|
||||
) {
|
||||
await this.serverlessFunctionService.deleteOneServerlessFunction({
|
||||
id: step.settings.input.serverlessFunctionId,
|
||||
workspaceId,
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user