From 3a91530365ff5890304c8807dde5fe97863c997b Mon Sep 17 00:00:00 2001 From: Roger Leite Lucena Date: Thu, 28 Mar 2019 20:14:31 -0300 Subject: [PATCH] Correcting bug inside utils --- .../components/topics/DynamicPagination/CreationForm/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 {