marmelab / ng-admin

Add an AngularJS admin GUI to any RESTful API
http://ng-admin-book.marmelab.com/
MIT License
3.95k stars 728 forks source link

onSubmitSuccess entry._identifierValue is unidentified #1327

Closed jamespsterling closed 7 years ago

jamespsterling commented 7 years ago

Based on the example code mentioned in the Docs, we're expecting entry to contain the ID value, but it does not.

Using latest master as of 3/20/2017.

  post.editionView().onSubmitSuccess(['progression', 'notification', '$state', 'entry', 'entity', function(progression, notification, $state, entry, entity) {
      // stop the progress bar
      progression.done();
      // add a notification
      notification.log(`Element #${entry._identifierValue} successfully edited.`, { addnCls: 'humane-flatty-success' });
      // redirect to the list view
      $state.go($state.get('list'), { entity: entity.name() });
      // cancel the default action (redirect to the edition view)
      return false;
  }])

Console.log(...) shows us the _identifierValue is unidentified in this context. image

... Thus the entry._identifierValue is unidentified in the notification,

notification.log(`Element #${entry._identifierValue} successfully edited.`,
Kmaschta commented 7 years ago

Hi @jamespsterling,

Can you provide a Plunkr that reproduce this error? It'll help us a lot to understand the issue.

jamespsterling commented 7 years ago

I think I realized this is my bug, the PUT I'm doing is not returning a copy of the 'edited' object.