fix: Restore missing tags in workflow retrieve (#5004)

This commit is contained in:
Omar Ajoue 2022-12-22 10:16:27 +01:00 committed by GitHub
parent 0a416eebea
commit 87d8865ad3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -87,10 +87,12 @@ EEWorkflowController.get(
ResponseHelper.send(async (req: WorkflowRequest.Get) => {
const { id: workflowId } = req.params;
const workflow = await EEWorkflows.get(
{ id: parseInt(workflowId, 10) },
{ relations: ['shared', 'shared.user', 'shared.role'] },
);
const relations = ['shared', 'shared.user', 'shared.role'];
if (!config.getEnv('workflowTagsDisabled')) {
relations.push('tags');
}
const workflow = await EEWorkflows.get({ id: parseInt(workflowId, 10) }, { relations });
if (!workflow) {
throw new ResponseHelper.NotFoundError(`Workflow with ID "${workflowId}" does not exist`);