👕 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, 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;
} }
} }