Credentials Subdomain
This commit is contained in:
@@ -19,5 +19,11 @@ export class AgileCrmApi implements ICredentialType {
|
||||
type: 'string' as NodePropertyTypes,
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Subdomain',
|
||||
name: 'subdomain',
|
||||
type: 'string' as NodePropertyTypes,
|
||||
default: '',
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
@@ -45,8 +45,9 @@ export async function agileCrmApiRequest(this: IHookFunctions | IExecuteFunction
|
||||
}
|
||||
|
||||
export async function agileCrmApiRequestUpdate(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method = 'PUT', endpoint?: string, body: any = {}, query: IDataObject = {}, uri?: string): Promise<any> { // tslint:disable-line:no-any
|
||||
const baseUri = 'https://n8nio.agilecrm.com/dev/';
|
||||
|
||||
const credentials = this.getCredentials('agileCrmApi');
|
||||
const baseUri = `https://${credentials!.subdomain}.agilecrm.com/dev/`;
|
||||
const options: OptionsWithUri = {
|
||||
method,
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user