bigbluebutton-Github/bigbluebutton-html5/imports/api/users/server/modifiers/changePin.js

26 lines
545 B
JavaScript
Raw Normal View History

import Logger from '/imports/startup/server/logger';
import Users from '/imports/api/users';
export default function changePin(meetingId, userId, pin, changedBy) {
const selector = {
meetingId,
userId,
};
const modifier = {
$set: {
pin,
},
};
try {
const numberAffected = Users.update(selector, modifier);
if (numberAffected) {
Logger.info(`Change pin=${pin} id=${userId} meeting=${meetingId} changedBy=${changedBy}`);
}
} catch (err) {
Logger.error(`Change pin error: ${err}`);
}
}