mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
v3 adapt v2: adapt common ops
This commit is contained in:
@@ -15,8 +15,12 @@ module.exports = function addWebhook (user, req = {}) {
|
||||
|
||||
user.markModified('preferences.webhooks');
|
||||
|
||||
return refPush(wh, {
|
||||
url: req.body.url,
|
||||
enabled: req.body.enabled,
|
||||
});
|
||||
if (req.v2 === true) {
|
||||
return user.preferences.webhooks;
|
||||
} else {
|
||||
return refPush(wh, {
|
||||
url: req.body.url,
|
||||
enabled: req.body.enabled,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user