diff --git a/app/Http/Controllers/Api/ProfileController.php b/app/Http/Controllers/Api/ProfileController.php index 696b1dd..a233412 100644 --- a/app/Http/Controllers/Api/ProfileController.php +++ b/app/Http/Controllers/Api/ProfileController.php @@ -29,10 +29,16 @@ class ProfileController extends Controller $user = Auth::user(); $profile = $user->profile; - $profileId = $user->role === 'petani' ? $profile->id : $request->id; + $requestID = null; + if($request->has('id')) { + $requestID = $request->id; + } + + $profileId = $user->role === 'petani' ? $profile->id : $$requestID; $desaKelurahanId = null; - if ($profile->role === 'fasilitator') { + if ($profile->role === 'fasilitator' || $profile->role === 'super_admin') { + $desaKelurahanId = $request->desa_kelurahan_id; $desaKelurahanId = $profile->desa_kelurahan_id; }