The parse.com object is not saved, although the Success method is called

I have the cloud code below to save a custom object into the Parse.Installation object with which it is associated.

In the cloud code logs, I see that the Success callback is called, but when I check the Installation object in the Analysis browser, the User attribute is "undefined".

Any ideas?

Parse.Cloud.define("saveUserWithInstallationObj", function(request, response) {

  //Get Installation object from installationId
  var query = new Parse.Query(Parse.Installation);
  query.equalTo("installationId", request.params.installationId);
  query.first({ 
    success: function(result) {
      if(result){       
        var currentUser = new Parse.User({id:request.params.userId});
        result.set("user", currentUser);
        result.save(null, {
          success: function(installation) {
            console.log("******SAVED Installation object");
            response.success();
          },
          error: function(e) {                              
            console.log(e);
            response.error(e.message);
          }
        });
      }else{
        //no results
      }

    },
    error: function(error) {
    }
  });  
});
+4
source share
1 answer

You set the user parameter in your code, but you say that the user parameter is empty on the control panel.

. , "" , "", . , , , . , "user", .

0

All Articles