diff options
author | Mateja <mail@matejamaric.com> | 2021-03-21 18:05:38 +0100 |
---|---|---|
committer | Mateja <mail@matejamaric.com> | 2021-03-21 18:05:38 +0100 |
commit | 2809ccf7272d4b77c5eb3f3d6599143dc4678d70 (patch) | |
tree | 1c46dd969ecbdb4b89e69051cab2395e2e510afe /resources/js/components | |
parent | 09ee04d39911f169457567c869d732a11387651a (diff) | |
download | yota-laravel-2809ccf7272d4b77c5eb3f3d6599143dc4678d70.tar.gz yota-laravel-2809ccf7272d4b77c5eb3f3d6599143dc4678d70.zip |
Work on `reservation.vue` component.
- Move Lodash cloneDeep to Vuex store.
Diffstat (limited to 'resources/js/components')
-rw-r--r-- | resources/js/components/reservation.vue | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/resources/js/components/reservation.vue b/resources/js/components/reservation.vue index 5389e1a..ec430ab 100644 --- a/resources/js/components/reservation.vue +++ b/resources/js/components/reservation.vue @@ -25,21 +25,21 @@ export default { props: [ 'reservationIndex' ], data() { return { - reservation: {} + reservation: this.$store.getters.getDataRow(this.reservationIndex) } }, - mounted() { - this.reservation = _.cloneDeep(this.$store.getters.getData[this.reservationIndex]); - }, methods: { updateRow() { - + this.$store.dispatch('pushReservation', { + index: this.reservationIndex, + reservation: this.reservation + }); }, restoreRow() { - this.reservation = _.cloneDeep(this.$store.getters.getData[this.reservationIndex]); + this.reservation = this.$store.getters.getDataRow(this.reservationIndex); }, deleteRow() { - + this.$store.dispatch('removeReservation', this.reservationIndex); } } } |