mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-13 05:47:31 -08:00
👕 Fix lint issue
This commit is contained in:
parent
189f90bf61
commit
f6808f212c
|
@ -110,20 +110,20 @@ export class AsanaTrigger implements INodeType {
|
||||||
target: webhookUrl,
|
target: webhookUrl,
|
||||||
};
|
};
|
||||||
|
|
||||||
let responseData
|
let responseData;
|
||||||
try {
|
try {
|
||||||
responseData = await asanaApiRequest.call(this, 'POST', endpoint, body);
|
responseData = await asanaApiRequest.call(this, 'POST', endpoint, body);
|
||||||
} catch(error) {
|
} catch(error) {
|
||||||
// delete webhook if it already exists
|
// delete webhook if it already exists
|
||||||
if (error.statusCode === 403) {
|
if (error.statusCode === 403) {
|
||||||
const webhookData = await asanaApiRequest.call(this, 'GET', endpoint, {}, { workspace });
|
const webhookData = await asanaApiRequest.call(this, 'GET', endpoint, {}, { workspace });
|
||||||
const webhook = webhookData.data.find((webhook: any) => {
|
const webhook = webhookData.data.find((webhook: any) => { // tslint:disable-line:no-any
|
||||||
return webhook.target === webhookUrl && webhook.resource.gid === resource
|
return webhook.target === webhookUrl && webhook.resource.gid === resource;
|
||||||
});
|
});
|
||||||
await asanaApiRequest.call(this, 'DELETE', `${endpoint}/${webhook.gid}`, {});
|
await asanaApiRequest.call(this, 'DELETE', `${endpoint}/${webhook.gid}`, {});
|
||||||
responseData = await asanaApiRequest.call(this, 'POST', endpoint, body);
|
responseData = await asanaApiRequest.call(this, 'POST', endpoint, body);
|
||||||
} else {
|
} else {
|
||||||
throw error
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue