diff --git a/src/store/modules/event.js b/src/store/modules/event.js index e416515..90ace78 100644 --- a/src/store/modules/event.js +++ b/src/store/modules/event.js @@ -1,5 +1,7 @@ import EventService from '@/services/EventService.js' +export const namespaced = true + export const state = { events: [], eventsTotal: 0, diff --git a/src/views/EventCreate.vue b/src/views/EventCreate.vue index 8080eed..a871d3e 100644 --- a/src/views/EventCreate.vue +++ b/src/views/EventCreate.vue @@ -65,7 +65,7 @@ export default { methods: { createEvent() { this.$store - .dispatch('createEvent', this.event) + .dispatch('event/createEvent', this.event) .then(() => { this.$router.push({ name: 'event-show', diff --git a/src/views/EventList.vue b/src/views/EventList.vue index d6cfac2..82f8b59 100644 --- a/src/views/EventList.vue +++ b/src/views/EventList.vue @@ -24,7 +24,7 @@ export default { this.perPage = 3 // Setting perPage here and not in data means it won't be reactive. // We don't need it to be reactive, and this way our component has access to it. - this.$store.dispatch('fetchEvents', { + this.$store.dispatch('event/fetchEvents', { perPage: this.perPage, page: this.page }) diff --git a/src/views/EventShow.vue b/src/views/EventShow.vue index 595b386..b8ae7c6 100644 --- a/src/views/EventShow.vue +++ b/src/views/EventShow.vue @@ -25,16 +25,17 @@