mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor(core): Ensure getSharedWorkflowIds returns string[] instead of number[] (#4971)
* 🔨 - getSharedWorkflowIds returns string[] * 🔨 - update the sharedWorkflow function in public api * 🔨 - update existing code to handle new data type * simplify code Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -405,13 +405,13 @@ export async function replaceInvalidCredentials(workflow: WorkflowEntity): Promi
|
||||
* Get the IDs of the workflows that have been shared with the user.
|
||||
* Returns all IDs if user is global owner (see `whereClause`)
|
||||
*/
|
||||
export async function getSharedWorkflowIds(user: User, roles?: string[]): Promise<number[]> {
|
||||
export async function getSharedWorkflowIds(user: User, roles?: string[]): Promise<string[]> {
|
||||
const sharedWorkflows = await Db.collections.SharedWorkflow.find({
|
||||
relations: ['workflow', 'role'],
|
||||
where: whereClause({ user, entityType: 'workflow', roles }),
|
||||
});
|
||||
|
||||
return sharedWorkflows.map(({ workflow }) => workflow.id);
|
||||
return sharedWorkflows.map(({ workflowId }) => workflowId.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user