radiks icon indicating copy to clipboard operation
radiks copied to clipboard

Bug/Question - Custom User model extended adds new entry on update

Open kkomaz opened this issue 5 years ago • 0 comments

Currently on my application I have a model that extends the User model. Fetching and retrieving information is working properly however when I update an attribute it seems to generate a new document entry.

Works (no new entry)

https://github.com/kkomaz/debut/blob/user-profile-image/src/sagas/user/setUserAvatar.js#L9

  • Finding the user via User model
  • update and save
  • refetch via DebutUser with the extra attributes

Doesn't Work

https://github.com/kkomaz/debut/blob/user-profile-image/src/sagas/user/setUserAvatar.js#L8

  • find the user via debutUser model
  • update and save
  • Creates a new entry

I'm guessing it has to do with the wrapped modeling.

screenshot of opera 3-4-19 7-13-19 pm

kkomaz avatar Mar 05 '19 00:03 kkomaz