Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-mayank committed Sep 12, 2024
1 parent d895de9 commit 5337c14
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 27 deletions.
19 changes: 16 additions & 3 deletions khelo/functions/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const teamRepository = new team_repository.TeamRepository(db);
const notificationService = new notification_service.NotificationService(userRepository);
const teamService = new team_service.TeamService(userRepository, notificationService);
const matchService = new match_service.MatchService(userRepository, teamRepository, notificationService);
const mailService = new mail_service.MailService(db);

const matchRepository = new match_repository.MatchRepository(db, matchService);

Expand All @@ -51,6 +50,20 @@ exports.fiveMinuteCron = (0, scheduler.onSchedule)({timeZone: exports.TIMEZONE,
await matchRepository.processUpcomingMatches();
});

exports.sendSupportRequest = onCall({ region: "asia-south1" }, async (request) => {
await mailService.sendMail(request.data);
exports.sendSupportRequest = onCall({ region: "asia-south1"}, async (request) => {

const db = admin.firestore();
var data = request.data;

await db.collection('support_requests')
.add({
to: ["radhika.s@canopas.com", "megh.l@canopas.com"],
template: {
name: "support_request",
data: {
request: data
},
},
}).then(() => console.log('Queued email for delivery!'));

});
24 changes: 0 additions & 24 deletions khelo/functions/src/mail/mail_service.js

This file was deleted.

0 comments on commit 5337c14

Please sign in to comment.