mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-26 05:04:05 -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,
|
||||
};
|
||||
|
||||
let responseData
|
||||
let responseData;
|
||||
try {
|
||||
responseData = await asanaApiRequest.call(this, 'POST', endpoint, body);
|
||||
} catch(error) {
|
||||
// delete webhook if it already exists
|
||||
if (error.statusCode === 403) {
|
||||
const webhookData = await asanaApiRequest.call(this, 'GET', endpoint, {}, { workspace });
|
||||
const webhook = webhookData.data.find((webhook: any) => {
|
||||
return webhook.target === webhookUrl && webhook.resource.gid === resource
|
||||
const webhook = webhookData.data.find((webhook: any) => { // tslint:disable-line:no-any
|
||||
return webhook.target === webhookUrl && webhook.resource.gid === resource;
|
||||
});
|
||||
await asanaApiRequest.call(this, 'DELETE', `${endpoint}/${webhook.gid}`, {});
|
||||
responseData = await asanaApiRequest.call(this, 'POST', endpoint, body);
|
||||
} else {
|
||||
throw error
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue