I am trying to retrieve data from the Database of Parse Server and I am facing a 500 Internal Error.
My class is "Friends" and the column is "fromUser", which is a Pointer to <_User> class.
The point is to get the usernames from the column "username" which is inside of the "User" Class.
I develop the app with Ionic 3 and trying to run the function with a current user logged in to retrieve the data.
My cloud code:
Parse.Cloud.define('FriendsQuery', function(req,res) {
const query = new Parse.Query("Friends");
query.equalTo("fromUser", request.params.currentuser);
query.find().then((results) => {
res.success(results);
})
.catch(() => {
response.error("user lookup failed");
});
});
and my typescript code
currentUser = Parse.User.current();
retrieveFriends(){
if (this.currentUser= Parse.User.current()) {
const passdata = Parse.User.current();
Parse.Cloud.run('FriendsQuery', {currentuser: this.currentUser }).then(
res => {
console.log(res)
}
)
}
}
Any ideas?