mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
wip: split shared ops
This commit is contained in:
9
common/script/ops/updateWebhook.js
Normal file
9
common/script/ops/updateWebhook.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import _ from 'lodash';
|
||||
|
||||
module.exports = function (user, req, cb) {
|
||||
_.merge(user.preferences.webhooks[req.params.id], req.body);
|
||||
if (typeof user.markModified === 'function') {
|
||||
user.markModified('preferences.webhooks');
|
||||
}
|
||||
return typeof cb === 'function' ? cb(null, user.preferences.webhooks) : void 0;
|
||||
};
|
||||
Reference in New Issue
Block a user