bigbluebutton-Github/bigbluebutton-html5/imports/api/users-infos/server/methods/removeUserInformation.js
2020-11-24 17:44:13 -03:00

22 lines
656 B
JavaScript

import UserInfos from '/imports/api/users-infos';
import Logger from '/imports/startup/server/logger';
import { extractCredentials } from '/imports/api/common/server/helpers';
export default function removeUserInformation() {
const { meetingId, requesterUserId } = extractCredentials(this.userId);
const selector = {
meetingId,
requesterUserId,
};
try {
const numberAffected = UserInfos.remove(selector);
if (numberAffected) {
Logger.info(`Removed user information: requester id=${requesterUserId} meeting=${meetingId}`);
}
} catch (err) {
Logger.error(`Removing user information from collection: ${err}`);
}
}