Add delete record action (#8908)

<img width="1272" alt="Capture d’écran 2024-12-05 à 18 04 19"
src="https://github.com/user-attachments/assets/dcbcc761-2f6d-4b6d-9e10-0f5b25d12c39">

- Adding new action
- Adding tests
- Moving into action folder
This commit is contained in:
Thomas Trompette
2024-12-06 13:02:17 +01:00
committed by GitHub
parent ab22fd560a
commit 5c565345ae
14 changed files with 483 additions and 100 deletions

View File

@ -169,6 +169,27 @@ export class WorkflowVersionStepWorkspaceService {
},
};
}
case `${WorkflowActionType.RECORD_CRUD}.${WorkflowRecordCRUDType.DELETE}`: {
const activeObjectMetadataItem =
await this.objectMetadataRepository.findOne({
where: { workspaceId, isActive: true, isSystem: false },
});
return {
id: newStepId,
name: 'Delete Record',
type: WorkflowActionType.RECORD_CRUD,
valid: false,
settings: {
...BASE_STEP_DEFINITION,
input: {
type: WorkflowRecordCRUDType.DELETE,
objectName: activeObjectMetadataItem?.nameSingular || '',
objectRecordId: '',
},
},
};
}
default:
throw new WorkflowVersionStepException(
`WorkflowActionType '${type}' unknown`,