Skip to content

Commit fc6a9a7

Browse files
Merge pull request #513 from abrain/patch-1
Docs: Fix usage of the .patch() method
2 parents 6630036 + 7d9e6fb commit fc6a9a7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/feathers-vuex-forms.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ export default {
458458
// Optionally make the event handler async.
459459
async save({ event, clone, prop, data }) {
460460
const user = clone.commit()
461-
return user.patch(data)
461+
return user.patch({ data })
462462
}
463463
}
464464
}
@@ -497,14 +497,14 @@ myCallback({ event, clone, prop, data }) {
497497
- `event {Event}`: the event which triggered the `handler` function in the slot scope.
498498
- `clone {clone}`: the cloned version of the `item` instance that was provided as a prop.
499499
- `prop {String}`: the name of the `prop` that is being edited (will always match the `prop` prop.)
500-
- `data {Object}`: An object containing the changes that were made to the object. Useful for calling `.patch(data)` on the original instance.
500+
- `data {Object}`: An object containing the changes that were made to the object. Useful for calling `.patch({ data })` on the original instance.
501501
502502
This callback needs to be customized to fit your business logic. You might patch the changes right away, as shown in this example callback function.
503503
504504
```js
505505
async save({ event, clone, prop, data }) {
506506
const user = clone.commit()
507-
return user.patch(data)
507+
return user.patch({ data })
508508
}
509509
```
510510
@@ -550,7 +550,7 @@ export default {
550550
// The callback can be async
551551
async save({ event, clone, prop, data }) {
552552
const user = clone.commit()
553-
return user.patch(data)
553+
return user.patch({ data })
554554
}
555555
}
556556
}
@@ -593,7 +593,7 @@ export default {
593593
// The callback can be async
594594
async save({ event, clone, prop, data }) {
595595
const user = clone.commit()
596-
return user.patch(data)
596+
return user.patch({ data })
597597
}
598598
}
599599
}
@@ -640,7 +640,7 @@ export default {
640640
// The original, non-debounced save function
641641
async function save({ event, clone, prop, data }) {
642642
const user = clone.commit()
643-
return user.patch(data)
643+
return user.patch({ data })
644644
}
645645
// The debounced wrapper around the save function
646646
const debouncedSave = _debounce(save, 100)

0 commit comments

Comments
 (0)