Skip to content

Commit 71fc151

Browse files
authored
Merge pull request #4171 from ebubecodes/patch-1
Fix: "Part 6d" - query key type mismatch in newNoteMutation cache update
2 parents 070deb3 + 30caf0f commit 71fc151

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/content/6/en/part6d.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,8 @@ const App = () => {
379379
mutationFn: createNote,
380380
// highlight-start
381381
onSuccess: (newNote) => {
382-
const notes = queryClient.getQueryData('notes')
383-
queryClient.setQueryData('notes', notes.concat(newNote))
382+
const notes = queryClient.getQueryData(['notes'])
383+
queryClient.setQueryData(['notes'], notes.concat(newNote))
384384
// highlight-end
385385
}
386386
})

src/content/6/fi/osa6d.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,8 @@ const App = () => {
380380
mutationFn: createNote,
381381
// highlight-start
382382
onSuccess: (newNote) => {
383-
const notes = queryClient.getQueryData('notes')
384-
queryClient.setQueryData('notes', notes.concat(newNote))
383+
const notes = queryClient.getQueryData(['notes'])
384+
queryClient.setQueryData(['notes'], notes.concat(newNote))
385385
// highlight-end
386386
}
387387
})

0 commit comments

Comments
 (0)