wip: split shared ops

This commit is contained in:
Matteo Pagliazzi
2016-03-07 23:02:42 +01:00
parent 8437c21a51
commit eeebe4c342
55 changed files with 1925 additions and 1634 deletions

View File

@@ -0,0 +1,15 @@
import refPush from '../libs/refPush';
module.exports = function(user, req, cb) {
var wh;
wh = user.preferences.webhooks;
api.refPush(wh, {
url: req.body.url,
enabled: req.body.enabled || true,
id: req.body.id
});
if (typeof user.markModified === "function") {
user.markModified('preferences.webhooks');
}
return typeof cb === "function" ? cb(null, user.preferences.webhooks) : void 0;
};