mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
27 lines
729 B
TypeScript
27 lines
729 B
TypeScript
import type { IRestApiContext, IShareWorkflowsPayload, IWorkflowsShareResponse } from '@/Interface';
|
|
import { makeRestApiRequest } from '@/utils/apiUtils';
|
|
import type { IDataObject } from 'n8n-workflow';
|
|
|
|
export async function setWorkflowSharedWith(
|
|
context: IRestApiContext,
|
|
id: string,
|
|
data: IShareWorkflowsPayload,
|
|
): Promise<IWorkflowsShareResponse> {
|
|
return await makeRestApiRequest(
|
|
context,
|
|
'PUT',
|
|
`/workflows/${id}/share`,
|
|
data as unknown as IDataObject,
|
|
);
|
|
}
|
|
|
|
export async function moveWorkflowToProject(
|
|
context: IRestApiContext,
|
|
id: string,
|
|
destinationProjectId: string,
|
|
): Promise<void> {
|
|
return await makeRestApiRequest(context, 'PUT', `/workflows/${id}/transfer`, {
|
|
destinationProjectId,
|
|
});
|
|
}
|