participants
This commit is contained in:
parent
0d350d32b0
commit
69c9121b00
|
|
@ -13,7 +13,7 @@ class HuntsController extends Controller
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$hunts = Hunts::with('participants')->paginate(10);
|
$hunts = Hunts::with('participants:id,avatarUri')->paginate(10);
|
||||||
return response()->json($hunts);
|
return response()->json($hunts);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
\Illuminate\Support\Facades\Log::error('Error fetching hunts: ' . $e->getMessage());
|
\Illuminate\Support\Facades\Log::error('Error fetching hunts: ' . $e->getMessage());
|
||||||
|
|
@ -47,7 +47,7 @@ class HuntsController extends Controller
|
||||||
*/
|
*/
|
||||||
public function show(Request $request, $id)
|
public function show(Request $request, $id)
|
||||||
{
|
{
|
||||||
$hunt = Hunts::with(['steps', 'participants'])->find($id);
|
$hunt = Hunts::with(['steps', 'participants:id,avatarUri'])->find($id);
|
||||||
|
|
||||||
if (!$hunt) {
|
if (!$hunt) {
|
||||||
return response()->json(['message' => 'Hunt not found'], 404);
|
return response()->json(['message' => 'Hunt not found'], 404);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue