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:
parent
90853dda96
commit
64b1945cbc
1 changed files with 2 additions and 1 deletions
|
|
@ -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({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue