Hi guys i have one really big problem. I have this pice of code
function showInfo(uint _pesel) public onlyMainPerson(msg.sender) returns (string memory, string memory) {
string memory x = showName(_pesel);
string memory y = showDate(_pesel);
return(x,y);
}
function showName(uint _pesel) private view returns( string memory) {
return(wills[_pesel].name);
}
function showDate(uint _pesel) private view returns( string memory) {
return(wills[_pesel].date);
}
And i want to use it in my web app, i'm doing it by
const names = await this.state.contract.methods.showInfo(123).send({from: this.state.account}, (e) => {
console.log("done")
console.log(names);
})
console.log(names);
But it is not working! It only shows "undefinded". How to solve it? Thanks in advance!