-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
Update mutation not changing store or backend #38
Comments
How are you calling the update? You probably need to call the the update method like this: this.updateUser([this.currentUserId, { ...this.getCurrentUser, name: 'Johannes' }]) But it would probably be better to use patch so you don't have to sent the rest of the data from the current user again |
@jskrzypek thanks for the reply. Your solution adds the new value indeed to the store, but for me not to the feathers backend. I am trying to follow the patch instructions from the docs here: It is actually just a type in the docs that causes the problem. This is the current doc for patch: let data = {description: 'write your tests', completed: true}
let params = {}
store.dispatch('todos/update', [1, data, params]) But it should actually state: let data = {description: 'write your tests', completed: true}
let params = {}
store.dispatch('todos/patch', [1, data, params]) Then everything works fine with just adding the changed values as payload. @marshallswain I am new to programming and don't want to mess up your docs :). Do you agree with the change? |
Ah, yes. Thanks @johannes90. I've fixed this in the 1.0 branch. |
Steps to reproduce
I want to populate a name field for one record of the user model that has already been created. The Vue component for this process:
Expected behavior
The action should update the vuex state and database entries in the feathers backend.
Actual behavior
The action triggers a mutation, as seen in the Vue Dev tools, but there is no value updated:
There is no change added in the backend either.
System configuration
feathers-vuex config
package.json
The text was updated successfully, but these errors were encountered: