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

26 lines
548 B
JavaScript
Raw Normal View History

2022-10-07 20:15:00 +08:00
import Logger from '/imports/startup/server/logger';
import Users from '/imports/api/users';
export default function setUserExitReason(meetingId, userId, reason) {
const selector = {
meetingId,
userId,
};
const modifier = {
$set: {
exitReason: reason,
},
};
try {
const numberAffected = Users.update(selector, modifier);
if (numberAffected) {
Logger.info(`Set exit reason userId=${userId} meeting=${meetingId}`);
}
} catch (err) {
Logger.error(`Setting user exit reason: ${err}`);
}
};