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:
martmull
2025-01-13 14:09:57 +01:00
committed by GitHub
parent 8643eaa28f
commit 5783d68d62
10 changed files with 64 additions and 33 deletions

View File

@ -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;
}
}