2021-03-20 04:12:27 +08:00
|
|
|
import { check } from 'meteor/check';
|
|
|
|
import UsersPersistentData from '/imports/api/users-persistent-data';
|
|
|
|
import Logger from '/imports/startup/server/logger';
|
|
|
|
|
2021-03-23 04:44:53 +08:00
|
|
|
export default function setloggedOutStatus(userId, meetingId, status = true) {
|
2021-03-20 04:12:27 +08:00
|
|
|
check(userId, String);
|
|
|
|
check(meetingId, String);
|
|
|
|
check(status, Boolean);
|
|
|
|
|
|
|
|
const selector = {
|
|
|
|
userId,
|
|
|
|
meetingId,
|
|
|
|
};
|
|
|
|
|
|
|
|
const modifier = {
|
|
|
|
$set: {
|
2021-03-23 04:44:53 +08:00
|
|
|
loggedOut: status,
|
2021-03-20 04:12:27 +08:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
try {
|
|
|
|
UsersPersistentData.update(selector, modifier);
|
|
|
|
} catch (err) {
|
|
|
|
Logger.error(`Adding note to the collection: ${err}`);
|
|
|
|
}
|
|
|
|
}
|