Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

Commit

Permalink
#21 notifications done on patient side
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexialsousa committed Apr 14, 2022
1 parent 0e923f8 commit bcf76f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion functions/src/triage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const requestDoctor = functions.https.onCall(async (_data, context)=>{

// send notification to doctor
const patientMessage: UserNotification = {
title: "New Doctor",
title: "Doctor Assigned",
message: `Dr. ${availableDoc.lastName} has been assigned to you`,
date: admin.firestore.Timestamp.now(),
read: false,
Expand Down
6 changes: 6 additions & 0 deletions src/components/chat/chatroom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ function Chat(props: ChatInfo) {
enablePatientAppointment({
userId: props.patientID,
});
const sendNotification = Firebase.functions().httpsCallable('sendNotification');
sendNotification({
title: 'Book an Appointment',
message: `Dr. ${state.lastName} has invited you to book a new appointment.`,
userId: props.patientID,
});
};
const { state } = React.useContext(UserContext);
const { role } = state;
Expand Down

0 comments on commit bcf76f0

Please sign in to comment.