refactor(core): Update tag endpoints to use DTOs and injectable config (#12380)

This commit is contained in:
Ricardo Espinoza
2025-01-09 14:17:11 -05:00
committed by GitHub
parent 95f055d23a
commit b1a40a231b
26 changed files with 282 additions and 103 deletions

View File

@@ -89,7 +89,7 @@ export class WorkflowsController {
const { tags: tagIds } = req.body;
if (tagIds?.length && !config.getEnv('workflowTagsDisabled')) {
if (tagIds?.length && !this.globalConfig.tags.disabled) {
newWorkflow.tags = await this.tagRepository.findMany(tagIds);
}
@@ -164,7 +164,7 @@ export class WorkflowsController {
await this.workflowHistoryService.saveVersion(req.user, savedWorkflow, savedWorkflow.id);
if (tagIds && !config.getEnv('workflowTagsDisabled') && savedWorkflow.tags) {
if (tagIds && !this.globalConfig.tags.disabled && savedWorkflow.tags) {
savedWorkflow.tags = this.tagService.sortByRequestOrder(savedWorkflow.tags, {
requestOrder: tagIds,
});
@@ -260,7 +260,7 @@ export class WorkflowsController {
},
};
if (!config.getEnv('workflowTagsDisabled')) {
if (!this.globalConfig.tags.disabled) {
relations.tags = true;
}
@@ -268,7 +268,7 @@ export class WorkflowsController {
workflowId,
req.user,
['workflow:read'],
{ includeTags: !config.getEnv('workflowTagsDisabled') },
{ includeTags: !this.globalConfig.tags.disabled },
);
if (!workflow) {
@@ -296,7 +296,7 @@ export class WorkflowsController {
workflowId,
req.user,
['workflow:read'],
{ includeTags: !config.getEnv('workflowTagsDisabled') },
{ includeTags: !this.globalConfig.tags.disabled },
);
if (!workflow) {