fix: Get workflow not returning home project and shared projects (no-changelog) (#9815)
This commit is contained in:
@@ -13,7 +13,6 @@ import { BadRequestError } from '@/errors/response-errors/bad-request.error';
|
||||
import { NotFoundError } from '@/errors/response-errors/not-found.error';
|
||||
import { Logger } from '@/Logger';
|
||||
import type {
|
||||
CredentialUsedByWorkflow,
|
||||
WorkflowWithSharingsAndCredentials,
|
||||
WorkflowWithSharingsMetaDataAndCredentials,
|
||||
} from './workflows.types';
|
||||
@@ -101,16 +100,15 @@ export class EnterpriseWorkflowService {
|
||||
const userCredentialIds = userCredentials.map((credential) => credential.id);
|
||||
workflowCredentials.forEach((credential) => {
|
||||
const credentialId = credential.id;
|
||||
const workflowCredential: CredentialUsedByWorkflow = {
|
||||
const filledCred = this.ownershipService.addOwnedByAndSharedWith(credential);
|
||||
workflow.usedCredentials?.push({
|
||||
id: credentialId,
|
||||
name: credential.name,
|
||||
type: credential.type,
|
||||
currentUserHasAccess: userCredentialIds.includes(credentialId),
|
||||
sharedWith: [],
|
||||
ownedBy: null,
|
||||
};
|
||||
credential = this.ownershipService.addOwnedByAndSharedWith(credential);
|
||||
workflow.usedCredentials?.push(workflowCredential);
|
||||
homeProject: filledCred.homeProject,
|
||||
sharedWithProjects: filledCred.sharedWithProjects,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import type { IUser } from 'n8n-workflow';
|
||||
import type { SharedWorkflow } from '@db/entities/SharedWorkflow';
|
||||
import type { WorkflowEntity } from '@db/entities/WorkflowEntity';
|
||||
import type { SlimProject } from '@/requests';
|
||||
@@ -21,6 +20,6 @@ export interface CredentialUsedByWorkflow {
|
||||
name: string;
|
||||
type?: string;
|
||||
currentUserHasAccess: boolean;
|
||||
ownedBy?: IUser | null;
|
||||
sharedWith?: IUser[];
|
||||
homeProject: SlimProject | null;
|
||||
sharedWithProjects: SlimProject[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user