* wip * wip * wip * wip * wip * wip * wip * wip * wip * fix * lint fix * cr fix * fix
This commit is contained in:
@@ -27,16 +27,16 @@ class CalculateUserUnavailableDaysController extends Controller
|
||||
|
||||
$holidays = $yearPeriod->holidays()->pluck("date");
|
||||
$vacationDays = $user->vacations()
|
||||
->where("year_period_id", $yearPeriod->id)
|
||||
->whereBelongsTo($yearPeriod)
|
||||
->whereRelation(
|
||||
"vacationRequest",
|
||||
fn(Builder $query) => $query->noStates(VacationRequestStatesRetriever::failedStates()),
|
||||
fn(Builder $query): Builder => $query->noStates(VacationRequestStatesRetriever::failedStates()),
|
||||
)
|
||||
->pluck("date");
|
||||
|
||||
return new JsonResponse([
|
||||
...$holidays->map(fn(Carbon $date) => $date->toDateString()),
|
||||
...$vacationDays->map(fn(Carbon $date) => $date->toDateString()),
|
||||
...$holidays->map(fn(Carbon $date): string => $date->toDateString()),
|
||||
...$vacationDays->map(fn(Carbon $date): string => $date->toDateString()),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user