Hi guys, great work with the forum!
Iโm trying to call a cloud function via REST API which requires two parameters.
When I call the function I am getting no results because the server is converting my number parameter to a string in the Input object
Example 1
If I run the cloud function from front end of app like this:
await Moralis.Cloud.run("testFunction",{name:"MP", number:5})
The logs display:
Input: {"name":"MP","number":5}
Result: [Loads of results, working normally]
Example 2 -
If I convert my cloud function into an API call and have something like this:
fetch('MYSERVER/server/functions/testFunction?_ApplicationId=MYAPPID&name=MP&number=5')
The logs display:
Input: "_ApplicationId":"MYAPPID","name":"MP","number":"5"}
Result: []
I notice that the function returns nothing because the number param is going through as a string and not a number.
Is there a simple way around that?