feat: show hunts
This commit is contained in:
parent
047292d0c1
commit
df3f98d1b7
|
|
@ -52,6 +52,38 @@ class HuntsController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
public function show(Hunts $hunt): JsonResponse
|
||||
{
|
||||
try {
|
||||
// Charger les relations nécessaires
|
||||
$hunt->load([
|
||||
'participants:id,username,avatar_uri,xp,level_id',
|
||||
'participants.currentLevel',
|
||||
'steps'
|
||||
]);
|
||||
|
||||
Log::info('HUNT_SHOW_SUCCESS', [
|
||||
'hunt_id' => $hunt->id,
|
||||
'hunt_title' => $hunt->title,
|
||||
]);
|
||||
|
||||
return response()->json($hunt);
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('HUNT_SHOW_ERROR', [
|
||||
'hunt_id' => $hunt->id ?? null,
|
||||
'message' => $e->getMessage(),
|
||||
'file' => $e->getFile(),
|
||||
'line' => $e->getLine(),
|
||||
'trace' => $e->getTraceAsString(),
|
||||
]);
|
||||
|
||||
return response()->json([
|
||||
'error' => 'Server Error',
|
||||
'message' => $e->getMessage(),
|
||||
], 500);
|
||||
}
|
||||
}
|
||||
|
||||
private function buildMeilisearchFilters(Request $request): string
|
||||
{
|
||||
$filters = [];
|
||||
|
|
|
|||
Loading…
Reference in New Issue