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

26 lines
540 B
JavaScript
Raw Normal View History

2019-11-20 01:49:18 +08:00
import Logger from '/imports/startup/server/logger';
import Users from '/imports/api/users';
export default async function setMobile(meetingId, userId) {
2019-11-20 01:49:18 +08:00
const selector = {
meetingId,
userId,
};
const modifier = {
$set: {
mobile: true,
},
};
try {
const numberAffected = await Users.updateAsync(selector, modifier);
2019-11-20 01:49:18 +08:00
if (numberAffected) {
2019-11-20 01:49:18 +08:00
Logger.info(`Assigned mobile user id=${userId} meeting=${meetingId}`);
}
} catch (err) {
Logger.error(`Assigning mobile user: ${err}`);
}
2019-11-20 01:49:18 +08:00
}