#157 - added support for the user id parameter

This commit is contained in:
2022-06-03 16:54:57 +02:00
parent 48ef40e8ff
commit 5f02e23f51
3 changed files with 32 additions and 11 deletions

View File

@@ -343,12 +343,13 @@ const props = defineProps({
users: Object,
holidays: Object,
can: Object,
userId: [Number, null],
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.users.data.find(user => user.id === (props.userId ?? props.auth.user.id)) ?? props.users.data[0]
: props.auth.user,
from: props.vacationStartDate,
to: null,