This commit is contained in:
Adrian Hopek
2022-01-24 14:57:59 +01:00
parent 595bb707e4
commit ed2fc06caa
12 changed files with 150 additions and 19 deletions

View File

@@ -92,7 +92,7 @@ export default {
setup() {
const form = useForm({
name: null,
date: new Date(),
date: null,
});
return { form };

View File

@@ -85,7 +85,7 @@ import { useForm } from '@inertiajs/inertia-vue3';
import FlatPickr from 'vue-flatpickr-component';
export default {
name: 'HolidayCreate',
name: 'HolidayEdit',
components: {
FlatPickr,
},
@@ -98,14 +98,15 @@ export default {
setup(props) {
const form = useForm({
name: props.holiday.name,
date: new Date(props.holiday.date),
date: props.holiday.date,
});
return { form };
},
methods: {
editHoliday() {
this.form.put(`/holidays/${this.holiday.id}`);
this.form
.put(`/holidays/${this.holiday.id}`);
},
},
};

View File

@@ -211,7 +211,7 @@ export default {
lastName: null,
email: null,
employmentForm: props.employmentForms[0],
employmentDate: new Date(),
employmentDate: null,
});
return { form };

View File

@@ -215,7 +215,7 @@ export default {
lastName: props.user.lastName,
email: props.user.email,
employmentForm: props.employmentForms.find(form => form.value === props.user.employmentForm),
employmentDate: new Date(props.user.employmentDate),
employmentDate: props.user.employmentDate,
});
return { form };