bigbluebutton-Github/bigbluebutton-html5/imports/api/captions/server/modifiers/clearCaptions.js

27 lines
712 B
JavaScript
Raw Normal View History

import Captions from '/imports/api/captions';
2017-01-18 20:53:33 +08:00
import Logger from '/imports/startup/server/logger';
export default async function clearCaptions(meetingId) {
2017-01-18 20:53:33 +08:00
if (meetingId) {
try {
const numberAffected = await Captions.removeAsync({ meetingId });
if (numberAffected) {
Logger.info(`Cleared Captions (${meetingId})`);
}
} catch (err) {
Logger.error(`Error on clearing captions (${meetingId}). ${err}`);
}
} else {
try {
const numberAffected = await Captions.removeAsync({});
2017-01-18 20:53:33 +08:00
if (numberAffected) {
Logger.info('Cleared Captions (all)');
}
} catch (err) {
Logger.error(`Error on clearing captions (all). ${err}`);
}
}
2017-06-03 03:25:02 +08:00
}