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

27 lines
806 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';
import { check } from 'meteor/check';
export default async function removeUserInformation() {
2021-05-06 00:53:28 +08:00
try {
const { meetingId, requesterUserId } = extractCredentials(this.userId);
2021-05-06 00:53:28 +08:00
check(meetingId, String);
check(requesterUserId, String);
2021-05-06 00:53:28 +08:00
const selector = {
meetingId,
requesterUserId,
};
const numberAffected = await UserInfos.removeAsync(selector);
if (numberAffected) {
Logger.info(`Removed user information: requester id=${requesterUserId} meeting=${meetingId}`);
}
} catch (err) {
2021-05-06 00:53:28 +08:00
Logger.error(`Exception while invoking method removeUserInformation ${err.stack}`);
}
}