Hi. am folowwing Moralis web3 paypal clone tutorial at https://www.youtube.com/watch?v=IwfIxAJiNiw&t=4435s
when trying to listen to Moralis API calls to get data from smart contract, am typing “node index.js” then
on the browser http://localhost:3001/getNameAndBalance?userAddress=0x3Ba8FC5bCBfa77398aD6867c9dA7D889D682c6D7
instead of getting a response, it shows the following error on VS code terminal:
params: { _user, userAddress },
^
ReferenceError: _user is not defined
what do you think might be the problem? here is the code responsible for it:
app.get(’/getNameAndBalance’, async (req, res) => {
const { userAddress } = req.query
const response = await Moralis.EvmApi.utils.runContractFunction({
chain: ‘0x13881’,
address: ‘0x05095a8CcBD0d74c8e1aAF3bD201Cf70457fB399’,
functionName: ‘getMyName’,
abi: ABI,
params: { _user, userAddress },
})
const jsonResponseName = response.raw
const jsonResponse = {
name: jsonResponseName,
}
return res.status(200).json(jsonResponse)
})