mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(Toggl Trigger Node): Update API version (#10207)
This commit is contained in:
@@ -24,21 +24,10 @@ export async function togglApiRequest(
|
||||
query?: IDataObject,
|
||||
uri?: string,
|
||||
) {
|
||||
const credentials = await this.getCredentials('togglApi');
|
||||
const headerWithAuthentication = Object.assign(
|
||||
{},
|
||||
{
|
||||
Authorization: ` Basic ${Buffer.from(
|
||||
`${credentials.username}:${credentials.password}`,
|
||||
).toString('base64')}`,
|
||||
},
|
||||
);
|
||||
|
||||
const options: IRequestOptions = {
|
||||
headers: headerWithAuthentication,
|
||||
method,
|
||||
qs: query,
|
||||
uri: uri || `https://api.track.toggl.com/api/v8${resource}`,
|
||||
uri: uri || `https://api.track.toggl.com/api/v9/me${resource}`,
|
||||
body,
|
||||
json: true,
|
||||
};
|
||||
@@ -46,7 +35,7 @@ export async function togglApiRequest(
|
||||
delete options.body;
|
||||
}
|
||||
try {
|
||||
return await this.helpers.request(options);
|
||||
return await this.helpers.requestWithAuthentication.call(this, 'togglApi', options);
|
||||
} catch (error) {
|
||||
throw new NodeApiError(this.getNode(), error as JsonObject);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user