From fa439f6df6244fe47a1662b5f00c6d90317a4294 Mon Sep 17 00:00:00 2001 From: Ashray Chowdhry Date: Wed, 6 Nov 2024 11:20:17 -0500 Subject: [PATCH] usequery cleanup --- .../components/TokenSearchResults/TokenSearchResults.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/containers/shared/components/TokenSearchResults/TokenSearchResults.tsx b/src/containers/shared/components/TokenSearchResults/TokenSearchResults.tsx index b21a83771..d2418319d 100644 --- a/src/containers/shared/components/TokenSearchResults/TokenSearchResults.tsx +++ b/src/containers/shared/components/TokenSearchResults/TokenSearchResults.tsx @@ -54,15 +54,14 @@ const SearchResults = ({ (accountLines) => accountLines.lines[0]?.limit ?? 0.0, ) - const fetchTokens = async () => { + const fetchTokens = () => { if (currentSearchValue === '') { return [] // Return an empty list if search is cleared } - const response = await axios.get( - `/api/v1/tokens/search/${currentSearchValue}`, - ) - return response.data.tokens + return axios + .get(`/api/v1/tokens/search/${currentSearchValue}`) + .then((response) => response.data.tokens) } const onLinkClick = () => {