bigbluebutton-Github/bigbluebutton-html5/imports/api/users-infos/server/methods/removeUserInformation.js

19 lines
642 B
JavaScript
Raw Normal View History

import UserInfos from '/imports/api/users-infos';
import Logger from '/imports/startup/server/logger';
2020-04-29 12:41:16 +08:00
import { extractCredentials } from '/imports/api/common/server/helpers';
2020-04-29 12:41:16 +08:00
export default function removeUserInformation() {
const { meetingId, requesterUserId } = extractCredentials(this.userId);
const selector = {
meetingId,
requesterUserId,
};
const cb = (err) => {
if (err) {
return Logger.error(`Removing user information from collection: ${err}`);
}
return Logger.info(`Removed user information: requester id=${requesterUserId} meeting=${meetingId}`);
};
return UserInfos.remove(selector, cb);
}