#157 - added the request class and improved the request parameters

This commit is contained in:
2022-06-06 11:05:47 +02:00
parent d4c5e55409
commit 04d036a1ef
5 changed files with 48 additions and 14 deletions

View File

@@ -89,7 +89,7 @@
<InertiaLink
v-if="day.isFuture"
href="/vacation/requests/create"
:data="{ 'start_date': day.date.toISODate() }"
:data="{ 'from_date': day.date.toISODate() }"
class="py-1.5 w-full font-medium bg-white hover:bg-blumilk-25 border-b-4 border-transparent focus:outline-blumilk-500"
>
<time

View File

@@ -173,6 +173,6 @@ function unsetActiveDay() {
}
function linkParameters(user, day) {
return props.can.createOnBehalfOfEmployee ? { user: user.id, start_date: day.date } : { start_date: day.date }
return props.can.createOnBehalfOfEmployee ? { user: user.id, from_date: day.date } : { from_date: day.date }
}
</script>

View File

@@ -343,16 +343,16 @@ const props = defineProps({
users: Object,
holidays: Object,
can: Object,
userId: [Number, null],
vacationStartDate: [String, null],
vacationUserId: [Number, null],
vacationFromDate: [String, null],
})
const form = useForm({
user: props.can.createOnBehalfOfEmployee
? props.users.data.find(user => user.id === (props.userId ?? props.auth.user.id)) ?? props.users.data[0]
? props.users.data.find(user => user.id === (props.vacationUserId ?? props.auth.user.id)) ?? props.users.data[0]
: props.auth.user,
from: props.vacationStartDate,
to: props.vacationStartDate,
from: props.vacationFromDate,
to: props.vacationFromDate,
vacationType: null,
comment: null,
flowSkipped: false,