I have two models in my application: Groups and Users. A Group 'owns' several Users.
In my application I am using the following code with the intent of limiting the updateAndFetchById method to a specific group.
myGroup
.$relatedQuery('users')
.updateAndFetchById(userId, request)
.then(function(user) {
...
});
The update operation works as expected: the user with the specified userId will only be updated if it also has groupId equal to the id of myGroup.
The problem in that the fetch operation will always return the user with the matching userId regardless of whether its groupId matches myGroup or not. Is this the intended behavior?
I noticed the same issue with patchAndFetchById.