mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 23:23:51 +00:00
updating openingdate parcours fixed
This commit is contained in:
@@ -5,9 +5,9 @@
|
||||
</h2>
|
||||
<div>
|
||||
<div class="mb-3 row">
|
||||
<label class="col-form-label col-sm-4">{{ $t('startdate.date') }}</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="date" v-model="startDate" @change="updateStartDate" />
|
||||
<div class="col-sm-12 date-update">
|
||||
<input class="form-control" type="date" id="startDate" v-model="startDate">
|
||||
<button class="btn btn-save date-update-btn" type="submit" @click="updateStartDate"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -23,10 +23,12 @@ import { mapState, mapGetters } from 'vuex';
|
||||
export default {
|
||||
name: 'startDate',
|
||||
methods: {
|
||||
updateStartDate(event) {
|
||||
const date = event.target.value;
|
||||
// console.log(date)
|
||||
updateStartDate(e) {
|
||||
e.preventDefault();
|
||||
const date = e.target.previousSibling.value;
|
||||
|
||||
this.$store.dispatch('updateStartDate', date)
|
||||
.then(this.$toast.open({type: 'success', message: this.$t('startdate.update')}))
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
@@ -43,4 +45,14 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.date-update {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
&-btn {
|
||||
margin-left: 1rem;
|
||||
}
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user