fix(Asana Node): Fix issue when connecting to the new Asana environment (#8404)

This commit is contained in:
Jon
2024-01-22 12:39:19 +00:00
committed by GitHub
parent 08e7db4648
commit 44f6ef2ed7
3 changed files with 152 additions and 144 deletions

View File

@@ -17,7 +17,7 @@ import get from 'lodash/get';
export async function asanaApiRequest(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
method: IHttpRequestMethods,
endpoint: string,
endpoint: `/${string}`,
body: object,
query?: IDataObject,
uri?: string | undefined,
@@ -33,6 +33,10 @@ export async function asanaApiRequest(
json: true,
};
if (options.body === null) {
delete options.body;
}
const credentialType = authenticationMethod === 'accessToken' ? 'asanaApi' : 'asanaOAuth2Api';
return await this.helpers.requestWithAuthentication.call(this, credentialType, options);
}
@@ -40,8 +44,7 @@ export async function asanaApiRequest(
export async function asanaApiRequestAllItems(
this: IExecuteFunctions | ILoadOptionsFunctions,
method: IHttpRequestMethods,
endpoint: string,
endpoint: `/${string}`,
body: any = {},
query: IDataObject = {},
): Promise<any> {