bigbluebutton-Github/bigbluebutton-html5/imports/api/users/server/modifiers/userLeftFlagUpdated.js
2023-03-20 16:35:52 -03:00

25 lines
561 B
JavaScript

import Logger from '/imports/startup/server/logger';
import Users from '/imports/api/users';
export default async function userLeftFlagUpdated(meetingId, userId, left) {
const selector = {
meetingId,
userId,
};
const modifier = {
$set: {
left,
},
};
try {
const numberAffected = await Users.updateAsync(selector, modifier);
if (numberAffected) {
Logger.info(`Updated user ${userId} with left flag as ${left} in meeting ${meetingId}`);
}
} catch (err) {
Logger.error(`Changed user role: ${err}`);
}
}