👕 Fix lint issue

This commit is contained in:
Jan Oberhauser 2019-11-30 18:05:34 +01:00
parent 189f90bf61
commit f6808f212c

View file

@ -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;
}
}