I wrote this but I have no idea how to debug it. Where can I see a log for any possible errors?
Moralis.Cloud.afterSave("tournamentsIssuedPolygon", async function(request) {
const tournamentId = request.object.get("tournamentId");
const ABI = [{
"inputs": [
{
"internalType": "uint256",
"name": "tournamentId",
"type": "uint256"
}
],
"name": "tournaments",
"outputs": [
{
"internalType": "bool",
"name": "active",
"type": "bool"
},
{
"internalType": "bool",
"name": "restrictContributors",
"type": "bool"
},
{
"internalType": "enum TournamentDAO.TournamentType",
"name": "tournamentType",
"type": "uint8"
},
{
"internalType": "enum TournamentDAO.TokenVersion",
"name": "tokenVersion",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "teamSize",
"type": "uint8"
},
{
"internalType": "uint256",
"name": "maxTeams",
"type": "uint256"
},
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "address payable",
"name": "organizer",
"type": "address"
},
{
"internalType": "uint256",
"name": "balance",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "buyInFee",
"type": "uint256"
},
{
"internalType": "address",
"name": "verifier",
"type": "address"
}
],
"stateMutability": "view",
"type": "function",
"constant": true
}];
const options = {
chain: "mumbai",
address: "0x1f37892605439062c4eC2BB46f62ebCAD98B23B5",
function_name: "tournaments",
abi: ABI,
params: {tournamentId: tournamentId}
};
const tournament = await Moralis.Web3API.native.runContractFunction(options);
request.object.set("organizer", tournament.organizer);
request.object.set("test", "testy");
return request.object.save();
});