mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
feat: allow passing subset of user settings on update route
This commit is contained in:
@@ -99,7 +99,11 @@ usersAPI.updateSettings = async function (caller, data) {
|
||||
throw new Error('[[error:no-privileges]]');
|
||||
}
|
||||
|
||||
return await user.saveSettings(data.uid, data.settings);
|
||||
const current = await user.getSettings(data.uid);
|
||||
const payload = { ...current, ...data.settings };
|
||||
delete payload.uid;
|
||||
|
||||
return await user.saveSettings(data.uid, payload);
|
||||
};
|
||||
|
||||
usersAPI.updateSetting = async function (caller, data) {
|
||||
|
||||
Reference in New Issue
Block a user