mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
🐛 Select base url depending on the datacenter (#1744)
This commit is contained in:
parent
f6fdf6b5e1
commit
31dd959109
|
@ -1,4 +1,7 @@
|
|||
import { OptionsWithUri } from 'request';
|
||||
import {
|
||||
OptionsWithUri,
|
||||
} from 'request';
|
||||
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
|
@ -9,6 +12,8 @@ import {
|
|||
} from 'n8n-workflow';
|
||||
|
||||
export async function zohoApiRequest(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, uri?: string, option: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
|
||||
const { oauthTokenData: { api_domain } } = this.getCredentials('zohoOAuth2Api') as { [key: string]: IDataObject };
|
||||
|
||||
const options: OptionsWithUri = {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
@ -20,7 +25,7 @@ export async function zohoApiRequest(this: IExecuteFunctions | IExecuteSingleFun
|
|||
],
|
||||
},
|
||||
qs,
|
||||
uri: uri || `https://www.zohoapis.com/crm/v2${resource}`,
|
||||
uri: uri || `${api_domain}/crm/v2${resource}`,
|
||||
json: true,
|
||||
};
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue