Hey guys,
I’m trying to allow users to type an address in the search bar and then allow my front end to show them information respective to the address they entered (all from the Moralis database).
This is what I have done so far:
const [address, setAddress] = useState("");
const { data: ownerWhoopys, isFetching: fetchingListedWhoopys, fetch } =
useMoralisQuery("CreatedWhoopys", (query) =>
query.equalTo("creatorAddress", address).limit(100).ascending("whoopyName"),
)
In my html, I have done:
<input onChange={(e) => setAddress(e.target.value)}/>
<button onClick={() => fetch}>Click</button>
How do I now get this fetched value and display it on my front end?
Currently (on another part of my website), I map through the data to get info regarding all addresses in the database. Is there a way for me to map through this fetched data? Currently when I click the button on the website nothing shows up.
How can I allow users to search my database and get relevant info?
Thanks!