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