wip
This commit is contained in:
parent
ba1d5bce2a
commit
f0bf30909c
@ -349,7 +349,7 @@ const props = defineProps({
|
||||
|
||||
const form = useForm({
|
||||
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,
|
||||
from: props.vacationFromDate,
|
||||
to: props.vacationFromDate,
|
||||
@ -427,6 +427,10 @@ function resetForm() {
|
||||
estimatedDays.value = []
|
||||
}
|
||||
|
||||
function checkUserId(userId) {
|
||||
return userId > 0 ? userId: null
|
||||
}
|
||||
|
||||
async function refreshEstimatedDays(from, to) {
|
||||
if (from && to) {
|
||||
const res = await axios.post('/api/vacation/calculate-days', { from, to })
|
||||
|
Loading…
x
Reference in New Issue
Block a user