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
This commit is contained in:
cristhianzl 2023-10-23 22:24:59 -03:00
commit 64b1945cbc

View file

@ -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({