Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

74
Views
How to make multiple commits Vuex?

after receiving the data from the request, I try to transfer them to the store. but it is not possible to transfer everything at once, only one at a time. how to solve this problem?

async loadFines({ commit }, payload) {
commit('setIsTableLoading', true);

try {
  const {
    data: {
      data: fines,
      meta: pagination,
      query: backendQuery,
    },
  } = await this.$axios.get('/fines', { params: payload });

  commit('setFinesList', fines);
  commit('setPagination', pagination);
  commit('setBackendQuery', backendQuery);

} catch (error) {
  console.log(error);
} finally {
  commit('setIsTableLoading', false);
}}

how to make those 3 commits properly?

export const mutations = {
  setFinesList(state, payload) {
    state.finesList = payload
  },

  setIsTableLoading(state, payload) {
    state.isTableLoading = payload;
  },

  setPagination(state, payload) {
    state.pagination = payload;
  },

  setLabels(state, payload) {
    state.labels = payload;
  },

  setBackendQuery(state, payload) {
    state.backendQuery = payload;
  }
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!