diff --git a/react/components/topics/DynamicPagination/CreationForm/utils.ts b/react/components/topics/DynamicPagination/CreationForm/utils.ts index 4cfb866..bd9d9f3 100644 --- a/react/components/topics/DynamicPagination/CreationForm/utils.ts +++ b/react/components/topics/DynamicPagination/CreationForm/utils.ts @@ -6,8 +6,9 @@ import { CachedBookList, CachedTotal } from '../../../../typings/custom' export const updateCache: MutationUpdaterFn = ( cache, - { data: { newBook } } + { data } ) => { + const { newBook } = data! // If the data is not present in the cache, the readQuery method will throw. // This happens when the user first visits this page and then go to the listing page try {