Why am I getting an error after successfully deleting Record in Ember

I get this error after calling deleteRecord and then save the object. I am using DS.RESTAdapter, and the removal works fine in the backend, but the console throws this error.

Error: No model was found for 'id' at new Error (native) at Error.Ember.Error (http://localhost:3000/assets/ember.js?body=1:913:19) at Ember.Object.extend.modelFor (http://localhost:3000/assets/ember-data.js?body=1:9808:33) at JSONSerializer.extend.extractSingle (http://localhost:3000/assets/ember-data.js?body=1:3021:28) at superWrapper [as extractSingle] (http://localhost:3000/assets/ember.js?body=1:1295:16) at Ember.Object.extend.extractSave (http://localhost:3000/assets/ember-data.js?body=1:2511:21) at Ember.Object.extend.extractDeleteRecord (http://localhost:3000/assets/ember-data.js?body=1:2468:21) at Ember.Object.extend.extract (http://localhost:3000/assets/ember-data.js?body=1:2368:37) at http://localhost:3000/assets/ember-data.js?body=1:10436:32 at invokeCallback (http://localhost:3000/assets/ember.js?body=1:10016:19) ember.js?body=1:3524 

Failed to get the error: approval failed: error: model not found for 'id'

 App.UserRoute = Ember.Route.extend({ actions: { deletetag: function(params) { this.get('store').find('usertag', params.id).then(function(rec){ rec.deleteRecord(); rec.save(); }); } } }); 

Why is ember trying to return an instance of the factory model named "id"?

Thanks!

0
source share
1 answer

Invalid error. The error was that the json returned from the destroy method was missing from the root of the object.

+1
source

All Articles