Skip to content

🎁 Patch with partial data

Compare
Choose a tag to compare
@marshallswain marshallswain released this 19 Mar 20:19
· 344 commits to master since this release

As of version 3.9.0, you can provide an object as params.data, and Feathers-Vuex will use params.data as the patch data. This change was made to the service-module, itself, so it will work for patch across all of feathers-vuex. Here's an example of patching with partial data:

import { models } from 'feathers-vuex'
const { Todo } = models.api

const todo = new Todo({ description: 'Do Something', isComplete: false })

todo.patch({ data: { isComplete: true } })

// also works for patching with instance.save
todo.save({ data: { isComplete: true } })