Send users_count on event task

This commit is contained in:
T'JAMPENS QUENTIN p2406187
2026-03-27 16:28:34 +01:00
parent 94beb74242
commit 5de0daa54a
+3 -1
View File
@@ -140,7 +140,9 @@ class EventsController extends Controller
public function getEvent(Request $request, int $id): JsonResponse {
try {
$event = Event::find($id);
$event = Event::with(['tasks' => function ($query) {
$query->withCount('users');
}])->find($id);
return response()->json([
"id" => $event->id,
"name" => $event->name,