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

25 lines
561 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 async function userLeftFlagUpdated(meetingId, userId, left) {
2022-01-07 05:07:22 +08:00
const selector = {
meetingId,
userId,
};
const modifier = {
$set: {
left,
},
};
try {
const numberAffected = await Users.updateAsync(selector, modifier);
2022-01-07 05:07:22 +08:00
if (numberAffected) {
Logger.info(`Updated user ${userId} with left flag as ${left} in meeting ${meetingId}`);
2022-01-07 05:07:22 +08:00
}
} catch (err) {
Logger.error(`Changed user role: ${err}`);
}
}