request id when null

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-04-29 15:36:20 +07:00
co-authored by Copilot
parent e46f91a87a
commit 9df021db1c
@@ -29,10 +29,16 @@ class ProfileController extends Controller
$user = Auth::user(); $user = Auth::user();
$profile = $user->profile; $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; $desaKelurahanId = null;
if ($profile->role === 'fasilitator') { if ($profile->role === 'fasilitator' || $profile->role === 'super_admin') {
$desaKelurahanId = $request->desa_kelurahan_id;
$desaKelurahanId = $profile->desa_kelurahan_id; $desaKelurahanId = $profile->desa_kelurahan_id;
} }