From c15f342513577e44ba9a70f16f156c6bb253e116 Mon Sep 17 00:00:00 2001 From: Cynthia Kamau Date: Mon, 1 Mar 2021 14:03:12 +0300 Subject: [PATCH] bug fix --- app/Http/Controllers/API/BroadcastsController.php | 2 +- app/Http/Controllers/API/ResourcesController.php | 2 +- app/Http/Controllers/API/UserController.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/API/BroadcastsController.php b/app/Http/Controllers/API/BroadcastsController.php index 0e5f86e..f44cf65 100644 --- a/app/Http/Controllers/API/BroadcastsController.php +++ b/app/Http/Controllers/API/BroadcastsController.php @@ -125,7 +125,7 @@ public function get_facility_broadcast_history($id) public function get_partner_broadcast_history($id) { - $hcws = PartnerFacility::where('partner_id',$id)->pluck('facility_id'); + $hcws = PartnerFacility::where('partner_id',$id)->pluck('facility_id')->first(); Log::info("HCWs:". $hcws); diff --git a/app/Http/Controllers/API/ResourcesController.php b/app/Http/Controllers/API/ResourcesController.php index 5031cbc..d9fd64a 100644 --- a/app/Http/Controllers/API/ResourcesController.php +++ b/app/Http/Controllers/API/ResourcesController.php @@ -514,7 +514,7 @@ public function get_partner_protocols($id) Log::info("HCWs:". $hcws); - return new GenericCollection(FacilityProtocol::where('facility_id',$hcws)->paginate(20)); + return new GenericCollection(FacilityProtocol::where('facility_id', '=',$hcws)->paginate(20)); } public function get_hcw_partner_protocols() diff --git a/app/Http/Controllers/API/UserController.php b/app/Http/Controllers/API/UserController.php index dea31b9..0c74554 100644 --- a/app/Http/Controllers/API/UserController.php +++ b/app/Http/Controllers/API/UserController.php @@ -82,7 +82,7 @@ public function get_facility_admin($id) if (is_null($facility)) abort(404, "Facility does not exist"); - return new GenericCollection(FacilityAdmin::where('facility_id', $id)->paginate(10)); + return new GenericCollection(FacilityAdmin::where('facility_id', '=', $id)->paginate(10)); } public function get_partner_users($id) @@ -91,7 +91,7 @@ public function get_partner_users($id) if (is_null($partner)) abort(404, "Partner does not exist"); - return new GenericCollection(PartnerUser::where('partner_id', $id)->paginate(100)); + return new GenericCollection(PartnerUser::where('partner_id', '=', $id)->paginate(100)); }