Skip to content

Commit

Permalink
added partner on registration
Browse files Browse the repository at this point in the history
  • Loading branch information
CynthiaKamau committed Mar 1, 2021
1 parent c67730a commit da5c099
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/Http/Controllers/API/ProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use App\CheckIn;
use App\Disease;
use App\HealthCareWorker;
use App\PartnerUser;
use App\Http\Resources\GenericCollection;
use App\Immunization;
use App\Otp;
Expand Down Expand Up @@ -55,6 +56,12 @@ public function complete_profile(Request $request)
$hcw->dob = $request->dob;
$hcw->id_no = $request->id_no;
$hcw->saveOrFail();

$hcw_partner = new PartnerUser();
$hcw_partner->partner_id = $request->partner_id;
$hcw_partner->user_id = $user->id;
$hcw_partner->saveOrFail();

}else{

$hcw->facility_id = $request->facility_id;
Expand All @@ -63,6 +70,7 @@ public function complete_profile(Request $request)
$hcw->dob = $request->dob;
$hcw->id_no = $request->id_no;
$hcw->update();

}


Expand Down

0 comments on commit da5c099

Please sign in to comment.