mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
refactor(core): Update tag endpoints to use DTOs and injectable config (#12380)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user