jeudi 19 octobre 2017

Ember deleting a freshly created record throws error

I create a record in my controller with record = store.createRecord(variables) Then I call record.save();

Some of the attributes i.e. the id are getting set in the API(Laravel). After creation the record shows up in my template. However I cannot delete this freshly created record.

It throws the error: Uncaught EmberError {description: undefined, fileName: undefined, lineNumber: undefined, message: "Assertion Failed:idpassed tofindRecord()has to be non-empty string or number", name: "Error", …}

When I look up in Ember Inspector the id is missing and it has the dirtyAttributes Flag set to true.

I already tried a route refresh and it didnt help. Also I tried to to modify my route with reload set to true:

model: function(params) {
    return this.store.findAll('rental', params.id, { reload: true });
  },

but this also didnt help. The only thing that works is to do a manual browser refresh (F5).

Any idea how I can get the full model reloaded?




Aucun commentaire:

Enregistrer un commentaire