Skip to content

Commit

Permalink
clear search message
Browse files Browse the repository at this point in the history
  • Loading branch information
SKarolFolio committed Dec 16, 2024
1 parent 0326654 commit 651cc94
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/common/hooks/useFetchSearchData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 651cc94

Please sign in to comment.