Delete an event from state and server from a list of events with Vuex ORM

77 Views Asked by At

I am able to remove events from their state with Vuex ORM with the following from a .vue file:

...
<tr v-for="event in events"
...
  <i class="fa fa-trash-o" @click="destroyEvent(event)"></i>
</tr>

export default {
  methods: {
    destroyEvent(event) {
      EventsModel.delete(event.id)
    }
  }
}

But this only removes it from its state, so when i reload the page, the events come back. How can I remove them from the server as well as the state with Vuex ORM?

1

There are 1 best solutions below

0
On

Solved with EventsModel.delete(url_path, option)