diff --git a/src/lib/components/Searchbar.svelte b/src/lib/components/Searchbar.svelte index 9180fe56..495c64e1 100644 --- a/src/lib/components/Searchbar.svelte +++ b/src/lib/components/Searchbar.svelte @@ -26,6 +26,29 @@ let inputElement; + async function loadSearchData() { + + if($searchBarData?.length !== 0) + { + return + } + else { + + // make the GET request to the endpoint + const response = await fetch(apiURL+'/searchbar-data', { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + }, + }); + + $searchBarData = await response.json(); + } + + + } + + function popularTicker(state, assetType) { searchOpen = false; @@ -294,7 +317,7 @@ $: { -