From 28ace375fe52564443f2e693a2dc22e4589b54b3 Mon Sep 17 00:00:00 2001 From: cp-mayank-v Date: Thu, 12 Sep 2024 16:25:43 +0530 Subject: [PATCH] Fix lint --- khelo/functions/src/index.js | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/khelo/functions/src/index.js b/khelo/functions/src/index.js index 6d870a3b..44ab12a7 100644 --- a/khelo/functions/src/index.js +++ b/khelo/functions/src/index.js @@ -49,20 +49,24 @@ exports.fiveMinuteCron = (0, scheduler.onSchedule)({timeZone: exports.TIMEZONE, await matchRepository.processUpcomingMatches(); }); -exports.sendSupportRequest = onCall({ region: "asia-south1"}, async (request) => { +exports.sendSupportRequest = onCall({ region: "asia-south1" }, async (request) => { - const db = admin.firestore(); - var data = request.data; + const db = admin.firestore(); + var data = request.data; + try { await db.collection('support_requests') - .add({ - to: ["sidhdhi.p@canopas.com", "mayank.v@canopas.com"], - template: { - name: "support_request", - data: { - request: data - }, - }, - }).then(() => console.log('Queued email for delivery!')); + .add({ + to: ["sidhdhi.p@canopas.com", "mayank.v@canopas.com"], + template: { + name: "support_request", + data: { + request: data + }, + }, + }).then(() => console.log('Queued email for delivery!')); + } catch (error) { + console.log('Failed to delivery email', error); + } });