s
This commit is contained in:
@@ -21,8 +21,8 @@ class PanenController extends Controller
|
|||||||
$user = Auth::user();
|
$user = Auth::user();
|
||||||
$profile = $user->profile;
|
$profile = $user->profile;
|
||||||
|
|
||||||
$profileId = $user->role === 'petani' ? $profile->id : $user->id;
|
$profileId = $user->role === 'petani' ? $profile->id : $request->id;
|
||||||
$listPanen = Panen::when($profileId, fn($q,$v) => $q->where('farmer_id',$v))->get();
|
$listPanen = Panen::when($profileId, fn($q,$v) => $q->where('farmer_id',$user->id))->get();
|
||||||
|
|
||||||
return response()->json($listPanen);
|
return response()->json($listPanen);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user