Skip to content

bug fix for update() call not working on custom objects #1

@Taskle

Description

@Taskle

Hi Aaron,

Wanted to let you know that my save() operations weren't working for my custom objects, and I figured out it was an issue with the update() CRUD call missing the classname and ID - below is the diff I used to get it to work.

Cheers,
Dave


@@ -57,8 +57,18 @@ function Sync( method, model, opts) {
break;
case "update":

Ti.API.info(' updating object with id ' + model.id);

  •        var params = model.toJSON(), id_name = object_name.replace(/s+$/, "") + "_id";
    
  •        var params = {};
    
  •        // if custom object then set the classname in params variable
    
  •        if (model.config.settings.object_method === "Objects") {
    
  •            params['classname'] = object_name;
    
  •        } 
    
  •        params['fields'] = model.toJSON();
    
  •        params['id'] = model.id;
    
  •        id_name = object_name.replace(/s+$/, "") + "_id";
         object_method.update(params, function(e) {
             if (e.success) {
                 model.meta = e.meta;
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions