diff --git a/functions/src/index.ts b/functions/src/index.ts index 4812211..c018e72 100644 --- a/functions/src/index.ts +++ b/functions/src/index.ts @@ -486,18 +486,18 @@ export const sendFCMNotificationByType = onRequest({ break; case 'client_invitations': - const isAccept = notification.status === 'ACCEPTED'; - title = isAccept ? 'Invitation Accepted' : 'Invitation Rejected'; - body = notification.message || (isAccept ? - `The invitation you shared has been accepted` : - `The invitation you shared has been rejected`); - data.gymName = notification.gymName || ''; - data.clientEmail = notification.clientEmail || ''; - data.clientName = notification.name || ''; - data.invitationId = notification.invitationId || ''; - data.subcriptionname= notification.subcriptionname || ''; - break; - + const isAccept = notification.status === 'ACCEPTED'; + title = isAccept ? 'Invitation Accepted' : 'Invitation Rejected'; + data.gymName = notification.gymName || ''; + data.clientEmail = notification.clientEmail || ''; + data.clientName = notification.name || ''; + data.invitationId = notification.invitationId || ''; + data.subcriptionname = notification.subcriptionName || ''; + body = notification.message || (isAccept ? + `The invitation for ${notification.subcriptionName} you shared with ${notification.name} has been accepted` : + `The invitation for ${notification.subcriptionName} you shared with ${notification.name} has been rejected`); + break; + default: logger.info(`Using default handling for notification type: ${notification.type}`); break;