From 64b1945cbcf5e59ae6ec73c2edc4cbd96f94c20f Mon Sep 17 00:00:00 2001 From: cristhianzl Date: Mon, 23 Oct 2023 22:24:59 -0300 Subject: [PATCH] feat(StorePage): update search data when fetching store components to ensure accurate search results fix(StorePage): set search data to an empty array when an error occurs to prevent displaying incorrect search results --- src/frontend/src/pages/StorePage/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/pages/StorePage/index.tsx b/src/frontend/src/pages/StorePage/index.tsx index 86e1a1bff..e0b9c41c1 100644 --- a/src/frontend/src/pages/StorePage/index.tsx +++ b/src/frontend/src/pages/StorePage/index.tsx @@ -55,12 +55,13 @@ export default function StorePage(): JSX.Element { setLoading(true); getStoreComponents(1, 10) .then((res) => { - console.log(res); + setSearchData(res); setLoading(false); setErrorApiKey(false); setData(res); }) .catch((err) => { + setSearchData([]); setLoading(false); setErrorApiKey(true); setErrorData({