wip
This commit is contained in:
		| @@ -349,7 +349,7 @@ const props = defineProps({ | |||||||
|  |  | ||||||
| const form = useForm({ | const form = useForm({ | ||||||
|   user: props.can.createOnBehalfOfEmployee |   user: props.can.createOnBehalfOfEmployee | ||||||
|     ? props.users.data.find(user => user.id === (props.vacationUserId ?? props.auth.user.id)) ?? props.users.data[0] |     ? props.users.data.find(user => user.id === (checkUserId(props.vacationUserId) ?? props.auth.user.id)) ?? props.users.data[0] | ||||||
|     : props.auth.user, |     : props.auth.user, | ||||||
|   from: props.vacationFromDate, |   from: props.vacationFromDate, | ||||||
|   to: props.vacationFromDate, |   to: props.vacationFromDate, | ||||||
| @@ -427,6 +427,10 @@ function resetForm() { | |||||||
|   estimatedDays.value = [] |   estimatedDays.value = [] | ||||||
| } | } | ||||||
|  |  | ||||||
|  | function checkUserId(userId) { | ||||||
|  |   return userId > 0 ? userId: null | ||||||
|  | } | ||||||
|  |  | ||||||
| async function refreshEstimatedDays(from, to) { | async function refreshEstimatedDays(from, to) { | ||||||
|   if (from && to) { |   if (from && to) { | ||||||
|     const res = await axios.post('/api/vacation/calculate-days', { from, to }) |     const res = await axios.post('/api/vacation/calculate-days', { from, to }) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user