Skip to content

Commit

Permalink
#386 - fix incorrect data display in vacation pop up (#387)
Browse files Browse the repository at this point in the history
* #386 - return count of vacations

* #386 - add missing vacation name
  • Loading branch information
vojcc authored Jan 23, 2024
1 parent b287176 commit 553ffc3
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
];
}
Expand Down

0 comments on commit 553ffc3

Please sign in to comment.