[SOLVED] Query not working correctly

I have the code below - however it is not working the way I need it to… I am querying the database to see if an nft is listed… Using the valid constant to ensure it returns a true or false in order for relevant data to show up on a modal I created… Not sure where I am going wrong but valid is not returning true for listed items

const { data: isListed } = useMoralisQuery(

  // TableName

  // Function for the query

  "ActiveItem",

  (query) => query.equalTo("nftAddress",nftAddress),

  (query) => query.equalTo("tokenId",token_id)

)

const valid = isListed.length === 1 || isListed === undefined

nevermind sorted thanks

1 Like