Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: [vuex] Do not mutate vuex store state outside mutation handlers. #48

Closed
dipesh112 opened this issue Dec 25, 2018 · 1 comment
Closed

Comments

@dipesh112
Copy link

vuex state
`const state ={

form: new Form({

        id:null,
        fullname: null,
        username: null,
        email: null,
        password: null,
        role:null
    }),

}`
vuex action

`
const action ={

storeData({commit,state}){
    commit('LOADING');
    return new Promise((resolve, reject)=>{
        let params = _.cloneDeep(state.form)

        axios.post(APP_CONFIG.API_URL+'/users',params)
        .then(response =>{
            commit('RESET_STATE')
            resolve();
        })
        .catch(error =>{
            //commit('ERROR',error)
            //reject(error)
        });
    });
},

}`

@dipesh112 dipesh112 changed the title validation erros not showing on vuex, erros object is empty Error: [vuex] Do not mutate vuex store state outside mutation handlers. Dec 25, 2018
@e1real
Copy link

e1real commented Aug 20, 2021

Hi, what was the reason for closing the issue? have you found a way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants