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

125
Views
vuex actions not committing mutations

i am trying to commit a simple mutation but it isn't working

import { createStore } from 'vuex'
import axios from 'axios';
export default createStore({
  state: {
    user:{
    }
  },
  mutations: {
    change_user(state ,payload) {
      state.user = payload;
    }
  },
  actions: {
   async get_data({commit}){
      let result = await  axios.get('http://localhost:3000/posts/');
      commit('change_user',result.data);

    }
  },
  modules: {
  }
})

but commit('change_user',result.data); seems to be not working

response : {balance: 32323, withdrawls: 23, earned_today: 3223, refers: 2323}

is something wrong in my code?

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!