Skip to content

Commit

Permalink
:))))))))))))))))
Browse files Browse the repository at this point in the history
  • Loading branch information
patrykyo20 committed Feb 22, 2024
1 parent f5c3486 commit 8a1d83f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions my-app/src/components/searchDrawer/SearchDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@ const SearchDrawer = () => {
const getproducts = async () => {
try {
setLoader(true)
const response = await getQueryProducts(searchKeys)
setSearchedData(response)
const response: any = await getQueryProducts(searchKeys)

if (typeof response === null) {
setSearchedData(response)
} else {
setSearchedData([])
}

} catch (error) {
console.error('Error fetching data:', error);
} finally {
Expand All @@ -28,6 +34,7 @@ const SearchDrawer = () => {
}

getproducts();
console.log(searchedData)
}, [searchKeys]);

const handleSearchInput: React.ChangeEventHandler<HTMLInputElement>= (event) => {
Expand Down

0 comments on commit 8a1d83f

Please sign in to comment.