#157 - added support for the date parameter
This commit is contained in:
parent
4309e8104b
commit
6fdd2ca049
@ -180,6 +180,7 @@ class VacationRequestController extends Controller
|
||||
"createOnBehalfOfEmployee" => $request->user()->can("createOnBehalfOfEmployee", VacationRequest::class),
|
||||
"skipFlow" => $request->user()->can("skipFlow", VacationRequest::class),
|
||||
],
|
||||
"vacationStartDate" => $request->get("start_date"),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -343,13 +343,14 @@ const props = defineProps({
|
||||
users: Object,
|
||||
holidays: Object,
|
||||
can: Object,
|
||||
vacationStartDate: [String, null],
|
||||
})
|
||||
|
||||
const form = useForm({
|
||||
user: props.can.createOnBehalfOfEmployee
|
||||
? props.users.data.find(user => user.id === props.auth.user.id) ?? props.users.data[0]
|
||||
: props.auth.user,
|
||||
from: null,
|
||||
from: props.vacationStartDate,
|
||||
to: null,
|
||||
vacationType: null,
|
||||
comment: null,
|
||||
@ -399,6 +400,7 @@ function createForm() {
|
||||
}
|
||||
|
||||
function onFromChange(selectedDates, dateStr) {
|
||||
console.log(form.from)
|
||||
if (form.to === null) {
|
||||
form.to = dateStr
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user