3 var userSettingsMuxer = require('../../../services/user-settings-muxer');
9 var settingsKey = req.params.userSetting;
10 var user = req.resourceUser;
12 var settings = settingsKey.split(/,/);
14 if (settings.length === 1) {
15 return userSettingsMuxer.getSetting(user, settingsKey);
17 return userSettingsMuxer.getSettings(user, settingsKey.split(','));
21 create: function(req) {
22 var valuesHash = req.body;
23 var user = req.resourceUser;
24 return userSettingsMuxer.updateSettings(user, valuesHash);
27 update: function(req) {
29 var user = req.resourceUser;
30 var settingsKey = req.params.userSetting;
32 return userSettingsMuxer.updateSetting(user, settingsKey, value);
35 respond: function(req, res, responseBody) {
36 switch (req.accepts(['json', 'text'])) {
38 res.send(responseBody);