-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
patch() method doesn't call 'patched' event handler. #39
Comments
@palavrov I suspect that this has something to do with something in the app preventing it from happening. If you do a simple test on a new, fresh service, do you get the same result? |
@marshallswain I'm debugging that right now and just find a workaround which seems to work for me, here is the code: var removeCableZones = function(zoneId) {
/* TODO: NeDB patch doesn't call 'patched' event handlers and doesn't
* notify web clients about patches.
return cablesService.patch( null, { zoneId: null }, { query: { zoneId: zoneId } });
*/
return cablesService.find({
query: {
zoneId: zoneId
}
}).then(function(cables) {
var actions = [];
cables = [].concat(cables);
cables.forEach(function(cable) {
cable.zoneId = null;
var action = cablesService.update(cable._id, cable);
actions.push(action);
});
return Promise.all(actions);
});
}; As you can see emulating |
Latest versions of everything? |
|
The problem is probably feathersjs/feathers#393 |
Indeed, seems exactly the same. Let's close this then. I was not expecting so quick reaction so: GUYS, YOU ARE AWESOME !!! FEATHERSJS REALLY ROCKS !!! |
It is difficult to extract example from my code but seems that
patched
event handler is not called when patching records with query. Neither the REST API updates web clients when patching.Could some one please explain me how patch method should work? I'm lost in the code and don't have time to figure it out myself right now in order to debug it deeper. Thanks.
The text was updated successfully, but these errors were encountered: