bigbluebutton-Github/bigbluebutton-html5/imports/api/users-infos/server/methods/removeUserInformation.js
2021-05-05 13:53:28 -03:00

27 lines
789 B
JavaScript

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