diff --git a/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_patient_list.dart b/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_patient_list.dart index fd11f5e8..d6335e09 100644 --- a/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_patient_list.dart +++ b/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_patient_list.dart @@ -78,6 +78,29 @@ class _BuildPatientsListState extends State { ), ); successPopUp(message); + addAccessReviewNotificationAPICall(index); + } else { + internetConnectionPopUp(); + } + } + + Future addAccessReviewNotificationAPICall(int index) async { + var response = await http.post( + Uri.parse("$baseAPI/notifications/insert/"), + headers: { + "Content-Type": "application/json; charset=UTF-8" + }, + body: jsonEncode({ + "app_id": widget.patients[index].app_id, + "notification_type": "Access Review", + "notification_message": + "A new Access Review request has been sent by ${widget.arguments.business!.Name}", + "action_path": "/access-review", + }), + ); + if (response.statusCode == 201) { + // Navigator.pushNamed(context, '/patient-manager/patient', + // arguments: widget.signedInUser); } else { internetConnectionPopUp(); }