mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
fix(API): Add shared field to workflows list rest API handler (#17804)
This commit is contained in:
committed by
GitHub
parent
a5fa808d4a
commit
31af6d11bb
@@ -103,7 +103,7 @@ export class ExportWorkflowsCommand extends BaseCommand<z.infer<typeof flagsSche
|
||||
|
||||
const workflows = await Container.get(WorkflowRepository).find({
|
||||
where: flags.id ? { id: flags.id } : {},
|
||||
relations: ['tags'],
|
||||
relations: ['tags', 'shared', 'shared.project'],
|
||||
});
|
||||
|
||||
if (workflows.length === 0) {
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
type: object
|
||||
additionalProperties: false
|
||||
properties:
|
||||
role:
|
||||
type: string
|
||||
example: 'workflow:owner'
|
||||
workflowId:
|
||||
type: string
|
||||
example: '2tUt1wbLX592XDdX'
|
||||
projectId:
|
||||
type: string
|
||||
example: '2tUt1wbLX592XDdX'
|
||||
project:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
readOnly: true
|
||||
name:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
readOnly: true
|
||||
createdAt:
|
||||
type: string
|
||||
format: date-time
|
||||
readOnly: true
|
||||
updatedAt:
|
||||
type: string
|
||||
format: date-time
|
||||
readOnly: true
|
||||
@@ -46,3 +46,7 @@ properties:
|
||||
items:
|
||||
$ref: '../../../tags/spec/schemas/tag.yml'
|
||||
readOnly: true
|
||||
shared:
|
||||
type: array
|
||||
items:
|
||||
$ref: './sharedWorkflow.yml'
|
||||
|
||||
@@ -225,18 +225,23 @@ export = {
|
||||
'meta',
|
||||
'versionId',
|
||||
'triggerCount',
|
||||
'shared',
|
||||
];
|
||||
|
||||
if (!excludePinnedData) {
|
||||
selectFields.push('pinData');
|
||||
}
|
||||
|
||||
const relations = ['shared'];
|
||||
if (!Container.get(GlobalConfig).tags.disabled) {
|
||||
relations.push('tags');
|
||||
}
|
||||
const [workflows, count] = await Container.get(WorkflowRepository).findAndCount({
|
||||
skip: offset,
|
||||
take: limit,
|
||||
select: selectFields,
|
||||
relations,
|
||||
where,
|
||||
...(!Container.get(GlobalConfig).tags.disabled && { relations: ['tags'] }),
|
||||
});
|
||||
|
||||
if (excludePinnedData) {
|
||||
|
||||
Reference in New Issue
Block a user