bigbluebutton-Github/bigbluebutton-html5/imports/api/users-settings/server/methods/addUserSettings.js

20 lines
568 B
JavaScript
Raw Normal View History

import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import addUserSetting from '/imports/api/users-settings/server/modifiers/addUserSetting';
2018-09-18 01:05:39 +08:00
export default function addUserSettings(credentials, meetingId, userId, settings) {
check(meetingId, String);
check(userId, String);
2018-09-18 01:05:39 +08:00
check(settings, Object);
2018-09-18 01:05:39 +08:00
const settingsAdded = [];
Object.entries(settings).forEach((el) => {
const setting = el[0];
const value = el[1];
settingsAdded.push(addUserSetting(meetingId, userId, setting, value));
});
return settingsAdded;
}