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

25 lines
520 B
JavaScript
Raw Normal View History

2022-01-07 05:07:22 +08:00
import Logger from '/imports/startup/server/logger';
import Users from '/imports/api/users';
export default function userLeftFlagUpdated(meetingId, userId, left) {
2022-01-07 05:07:22 +08:00
const selector = {
meetingId,
userId,
};
const modifier = {
$set: {
left,
},
};
try {
const numberAffected = Users.update(selector, modifier);
if (numberAffected) {
Logger.info(`Updated user ${userId} with left flag as ${left}`);
}
} catch (err) {
Logger.error(`Changed user role: ${err}`);
}
}