From 553ffc33eac41cc62510d25e6916937223dc66c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20W=C3=B3jcik?= <92044526+vojcc@users.noreply.github.com> Date: Tue, 23 Jan 2024 08:13:32 +0100 Subject: [PATCH] #386 - fix incorrect data display in vacation pop up (#387) * #386 - return count of vacations * #386 - add missing vacation name --- .../Http/Resources/DashboardVacationRequestResource.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/Infrastructure/Http/Resources/DashboardVacationRequestResource.php b/app/Infrastructure/Http/Resources/DashboardVacationRequestResource.php index b90b3d34..04e3a295 100644 --- a/app/Infrastructure/Http/Resources/DashboardVacationRequestResource.php +++ b/app/Infrastructure/Http/Resources/DashboardVacationRequestResource.php @@ -22,17 +22,16 @@ public function __construct($resource) public function toArray($request): array { - $user = $request->user(); - return [ "id" => $this->id, "user" => new SimpleUserResource($this->user), + "name" => $this->name, "type" => $this->type, "state" => $this->state, "from" => $this->from->toDisplayString(), "to" => $this->to->toDisplayString(), "displayDate" => $this->getDate($this->from->toDisplayString(), $this->to->toDisplayString()), - "days" => VacationResource::collection($this->vacations), + "days" => $this->vacations->count(), "pending" => $this->state->equals(...VacationRequestStatesRetriever::pendingStates()), ]; }