From 651cc94822041f399667dd0bd4e88c7a0f5af40f Mon Sep 17 00:00:00 2001 From: Siarhei Karol Date: Mon, 16 Dec 2024 17:37:18 +0300 Subject: [PATCH] clear search message --- src/common/hooks/useFetchSearchData.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/hooks/useFetchSearchData.ts b/src/common/hooks/useFetchSearchData.ts index dede8f9b..157fe0b9 100644 --- a/src/common/hooks/useFetchSearchData.ts +++ b/src/common/hooks/useFetchSearchData.ts @@ -24,7 +24,7 @@ export const useFetchSearchData = () => { precedingRecordsCount, } = useSearchContext(); const { setIsLoading } = useLoadingState(); - const { setMessage, data, setData, resetData, setPageMetadata } = useSearchState(); + const { setMessage, resetMessage, data, setData, resetData, setPageMetadata } = useSearchState(); const { addStatusMessagesItem } = useStatusState(); const validateAndNormalizeQuery = useCallback( @@ -175,6 +175,7 @@ export const useFetchSearchData = () => { setData(content); setPageMetadata({ totalPages, totalElements: totalRecords, prev, next }); + resetMessage(); } catch { addStatusMessagesItem?.(UserNotificationFactory.createMessage(StatusType.error, 'ld.errorFetching')); } finally {