API fix - retrieve gpx file

This commit is contained in:
Ale Gallo 2024-02-09 16:09:37 +01:00
parent 09143cdeca
commit 6d82ab8901

View file

@ -117,9 +117,8 @@ class RouteController extends Controller
// Download the GPX file for a specific route and sport // Download the GPX file for a specific route and sport
public function downloadGpx($id, $sportId) public function downloadGpx($id, $sportId)
{ {
$routeDetail = RouteSportDetails::where(['route_id' => $id, 'sport_id' => $sportId]) $routeDetail = RouteSportDetails::where(['route_id' => $id, 'sport_id' => $sportId])->first();
->first(); $file = storage_path("{$routeDetail->gpx_path}");
$file = storage_path("app/{$routeDetail->gpx_path}");
return response()->download($file); return response()->download($file);
} }