feat(API): Add user management endpoints to the Projects Public API (#12329)

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
Co-authored-by: Danny Martini <danny@n8n.io>
Co-authored-by: Andreas Fitzek <andreas.fitzek@n8n.io>
Co-authored-by: Guillaume Jacquart <jacquart.guillaume@gmail.com>
This commit is contained in:
Marc Littlemore
2025-05-30 12:04:38 +01:00
committed by GitHub
parent c229e915ea
commit 4459c7e7b1
25 changed files with 1391 additions and 71 deletions

View File

@@ -66,3 +66,23 @@ export const getProjectRelations = async ({
where: { projectId, userId, role },
});
};
export const getProjectRoleForUser = async (
projectId: string,
userId: string,
): Promise<ProjectRole | undefined> => {
return (
await Container.get(ProjectRelationRepository).findOne({
select: ['role'],
where: { projectId, userId },
})
)?.role;
};
export const getAllProjectRelations = async ({
projectId,
}: Partial<ProjectRelation>): Promise<ProjectRelation[]> => {
return await Container.get(ProjectRelationRepository).find({
where: { projectId },
});
};