viezel / napp.alloy.adapter.restapi

RestAPI Sync Adapter for Titanium Alloy Framework
197 stars 102 forks source link

parentNode issues on PUT DELETE and UPDATE #84

Open jasonkneen opened 7 years ago

jasonkneen commented 7 years ago

If you have parentNode set for GET then you get errors on using PUT, DELETE, UPDATE etc if the returning JSON doesn't include that node.

Current workaround is doing this in the model config:

parentNode: function(data) {
    data = data || [];
    return data.tasks || data;
}

which will get around the issue and just pass back the data returned -- will look at how that could be integrated into the adapter.