feat(core): Allow transferring folder to project root with delete operation (no-changelog) (#14074)

This commit is contained in:
Ricardo Espinoza
2025-03-20 08:43:03 -04:00
committed by GitHub
parent 1a26fc2762
commit d4e7a2cd96
3 changed files with 64 additions and 6 deletions
@@ -619,9 +619,12 @@ export class WorkflowRepository extends Repository<WorkflowEntity> {
WorkflowEntity,
{ parentFolder: { id: fromFolderId } },
{
parentFolder: {
id: toFolderId,
},
parentFolder:
toFolderId === PROJECT_ROOT
? null
: {
id: toFolderId,
},
},
);
}
+3 -1
View File
@@ -138,7 +138,9 @@ export class FolderService {
throw new UserError('Cannot transfer folder contents to the folder being deleted');
}
await this.findFolderInProjectOrFail(transferToFolderId, projectId);
if (transferToFolderId !== PROJECT_ROOT) {
await this.findFolderInProjectOrFail(transferToFolderId, projectId);
}
return await this.folderRepository.manager.transaction(async (tx) => {
await this.folderRepository.moveAllToFolder(folderId, transferToFolderId, tx);