class Navy extends Component {
constructor(props) {
super(props);
this.state = {
showsearch: false,
searchcontent: null
}
this.openSearch = this.openSearch.bind(this);
this.closeSearch = this.closeSearch.bind(this);
this.handleChange = this.handleChange.bind(this)
}
openSearch() {
this.setState({ showsearch: true });
}
closeSearch() {
let vm = this;
setTimeout(() => {
vm.setState({ showsearch: false });
}, 100);
}
handleChange(e) {
var value = e.target.value;
this.setState({searchcontent: value});
}
render() {
const Moralis = require('moralis')
const params = { value: this.state.searchcontent};
const results = async () => {
try {
const x3 = await Moralis.Cloud.run("searchResults", params);
return("x3", x3);
} catch (e) {
return(e);
}
};
return(
<Modal show={this.state.showsearch} onHide={this.closeSearch} size='lg' centered >
<Modal.Header >
<Modal.Title>Search</Modal.Title>
</Modal.Header>
<Modal.Body>
Search Results #: {results.length} <br/>
Result (JSON): {JSON.stringify(results)} <br/>
Result: {results}
</Modal.Body>
<Modal.Footer>
<Button variant="secondary" onClick={this.closeSearch}>
Close
</Button>
</Modal.Footer>
</Modal>
)}}
literally nothing is returningā¦ no error, not even the āx3ā string