From 758689d376c2455fff0e680326a8423de9bca13e Mon Sep 17 00:00:00 2001 From: Adrian Hopek Date: Wed, 2 Mar 2022 09:52:25 +0100 Subject: [PATCH] #43 - cr fix --- app/Infrastructure/Http/Controllers/DashboardController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Infrastructure/Http/Controllers/DashboardController.php b/app/Infrastructure/Http/Controllers/DashboardController.php index e42bf42..d8ff41d 100644 --- a/app/Infrastructure/Http/Controllers/DashboardController.php +++ b/app/Infrastructure/Http/Controllers/DashboardController.php @@ -50,6 +50,7 @@ class DashboardController extends Controller $used = $vacationStatsRetriever->getUsedVacationDays($user, $yearPeriod); $pending = $vacationStatsRetriever->getPendingVacationDays($user, $yearPeriod); $other = $vacationStatsRetriever->getOtherApprovedVacationDays($user, $yearPeriod); + $remaining = $limit - $used - $pending; return inertia("Dashboard", [ "absences" => AbsenceResource::collection($absences), @@ -57,7 +58,7 @@ class DashboardController extends Controller "holidays" => HolidayResource::collection($holidays), "stats" => [ "limit" => $limit, - "remaining" => $limit - $used - $pending, + "remaining" => $remaining, "used" => $used, "pending" => $pending, "other" => $other,