radiks
radiks copied to clipboard
Bug/Question - Custom User model extended adds new entry on update
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.