From 48ef40e8ff66ac1b46e09824edd24d396fc0bb13 Mon Sep 17 00:00:00 2001 From: Kamil Niemczycki Date: Fri, 3 Jun 2022 14:04:16 +0200 Subject: [PATCH] #157 - added a privilege check --- .../Http/Controllers/VacationCalendarController.php | 1 + resources/js/Pages/Calendar.vue | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Infrastructure/Http/Controllers/VacationCalendarController.php b/app/Infrastructure/Http/Controllers/VacationCalendarController.php index 20d1678..2673f6f 100644 --- a/app/Infrastructure/Http/Controllers/VacationCalendarController.php +++ b/app/Infrastructure/Http/Controllers/VacationCalendarController.php @@ -44,6 +44,7 @@ class VacationCalendarController extends Controller "users" => SimpleUserResource::collection($users), "can" => [ "generateTimesheet" => $request->user()->can("generateTimesheet"), + "createOnBehalfOfEmployee" => $request->user()->can("createOnBehalfOfEmployee"), ], ]); } diff --git a/resources/js/Pages/Calendar.vue b/resources/js/Pages/Calendar.vue index 50a30d2..f8db8b8 100644 --- a/resources/js/Pages/Calendar.vue +++ b/resources/js/Pages/Calendar.vue @@ -101,7 +101,7 @@ :key="day.dayOfMonth" class="border border-gray-300" :class="{ 'bg-blumilk-25': day.isToday, 'bg-red-100': day.isWeekend || day.isHoliday }" - @mouseover="setActiveBtn(user.id.toString() + '' + day.date)" + @mouseover="setActiveBtn(user.id + '+' + day.date)" @mouseleave="unsetActiveBtn" >
@@ -146,6 +146,8 @@ const props = defineProps({ can: Object, }) +console.log(props.auth.user) + let activeElement = ref(undefined) const { getMonths, findMonth } = useMonthInfo()