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?