2022-01-07 05:07:22 +08:00
|
|
|
import Logger from '/imports/startup/server/logger';
|
|
|
|
import Users from '/imports/api/users';
|
|
|
|
|
2022-02-17 02:46:02 +08:00
|
|
|
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}`);
|
|
|
|
}
|
|
|
|
}
|