mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor(editor): Move editor-ui and design-system to frontend dir (no-changelog) (#13564)
This commit is contained in:
26
packages/frontend/editor-ui/src/api/credentials.ee.ts
Normal file
26
packages/frontend/editor-ui/src/api/credentials.ee.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import type { ICredentialsResponse, IRestApiContext, IShareCredentialsPayload } from '@/Interface';
|
||||
import { makeRestApiRequest } from '@/utils/apiUtils';
|
||||
import type { IDataObject } from 'n8n-workflow';
|
||||
|
||||
export async function setCredentialSharedWith(
|
||||
context: IRestApiContext,
|
||||
id: string,
|
||||
data: IShareCredentialsPayload,
|
||||
): Promise<ICredentialsResponse> {
|
||||
return await makeRestApiRequest(
|
||||
context,
|
||||
'PUT',
|
||||
`/credentials/${id}/share`,
|
||||
data as unknown as IDataObject,
|
||||
);
|
||||
}
|
||||
|
||||
export async function moveCredentialToProject(
|
||||
context: IRestApiContext,
|
||||
id: string,
|
||||
destinationProjectId: string,
|
||||
): Promise<void> {
|
||||
return await makeRestApiRequest(context, 'PUT', `/credentials/${id}/transfer`, {
|
||||
destinationProjectId,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user