feat: show hunts

This commit is contained in:
Leon 2026-01-30 17:09:38 +01:00
parent 047292d0c1
commit df3f98d1b7
1 changed files with 32 additions and 0 deletions

View File

@ -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 private function buildMeilisearchFilters(Request $request): string
{ {
$filters = []; $filters = [];