We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 288308e commit dae15ccCopy full SHA for dae15cc
1 file changed
README.md
@@ -80,9 +80,9 @@ import { useOptimisticMutation } from "@tanstack/react-optimistic"
80
const AddTodo = () => {
81
const addTodo = useOptimisticMutation({
82
mutationFn: async ({ transaction }) => {
83
- const { collection, ...newTodo } = transaction.mutations[0]!
+ const { collection, modified: newTodo } = transaction.mutations[0]!
84
85
- await axios.post("/api/todos", newTodo)
+ await api.todos.create(newTodo)
86
await collection.invalidate()
87
},
88
})
0 commit comments