React - API key into string

0 votes
30 views
added Mar 13 in JSX by lcjr First Warrant Officer (11,830 points)

To achieve the desired outcome of converting occupancy_type.is_buy into a string "sale", you can modify the logic within your handleSearch function. Here's how you can do it:

let occupancyTypeString = '';

if ( is_property_scouting_score > 7 && is_find_agent_score > 9 ) {
  setSearchResult(response.content);
  if (occupancy_type.is_buy) {
    occupancyTypeString = 'sale';
  }
}

else {
  setSearchResult('Conditions not met');
}
console.log(occupancyTypeString);
lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...