Skip to content

Commit

Permalink
Updating the EventController with the last incident resource
Browse files Browse the repository at this point in the history
  • Loading branch information
diego-maeda committed Aug 17, 2024
1 parent 125404a commit fe2dcc4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/EventsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ public function findNext(Request $request): JsonResponse
public function latest(): JsonResponse
{
$event = Event::where('precinct', '33705')->latest('crime_date')->first();
return response()->json(['event' => $event]);
return response()->json(['event' => new LastIncidentResource($event)]);
}
}

0 comments on commit fe2dcc4

Please sign in to comment.