mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
17 lines
476 B
TypeScript
17 lines
476 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 makeRestApiRequest(
|
|
context,
|
|
'PUT',
|
|
`/workflows/${id}/share`,
|
|
data as unknown as IDataObject,
|
|
);
|
|
}
|