notification-bug-fix (#86)
All checks were successful
Deploy FitLien services to Dev / Deploy to Dev (push) Successful in 3m37s
All checks were successful
Deploy FitLien services to Dev / Deploy to Dev (push) Successful in 3m37s
Reviewed-on: #86 Reviewed-by: Dhansh A S <dhanshas@cosq.net> Co-authored-by: Sharon Dcruz <sharondcruz@cosq.net> Co-committed-by: Sharon Dcruz <sharondcruz@cosq.net>
This commit is contained in:
parent
c2914b16bb
commit
d8ae223cce
@ -4,6 +4,7 @@ import * as admin from "firebase-admin";
|
||||
|
||||
const app = getAdmin();
|
||||
const logger = getLogger();
|
||||
const kTrainerRole = 'Trainer';
|
||||
|
||||
interface MembershipData {
|
||||
id?: string;
|
||||
@ -545,6 +546,7 @@ async function sendTrainerNotifications(
|
||||
try {
|
||||
const trainerName = await getTrainerName(assignment.trainerId);
|
||||
const trainerUserId = await getTrainerUserId(assignment.trainerId);
|
||||
|
||||
|
||||
const notifType =
|
||||
notificationType === "expired"
|
||||
@ -588,6 +590,7 @@ async function sendTrainerNotifications(
|
||||
gymName,
|
||||
assignmentId: assignment.id,
|
||||
formattedExpiryDate: formattedDate,
|
||||
role: kTrainerRole,
|
||||
expiryDate: expiryDate
|
||||
? admin.firestore.Timestamp.fromDate(expiryDate)
|
||||
: admin.firestore.Timestamp.fromDate(new Date()),
|
||||
|
||||
@ -181,8 +181,8 @@ function prepareNotificationMessage(
|
||||
title =
|
||||
notification.data?.title ||
|
||||
(notification.data?.status === "accepted"
|
||||
? "Trainer Request Accepted"
|
||||
: "Trainer Request Update");
|
||||
? "Trainer Invitation Accepted"
|
||||
: "Trainer Invitation Update");
|
||||
body =
|
||||
notification.data?.message ||
|
||||
`${
|
||||
|
||||
Loading…
Reference in New Issue
Block a user