bigbluebutton-Github/bigbluebutton-html5/imports/api/captions/server/modifiers/updateReadOnlyPadId.js
Pedro Beschorner Marin 741122df96 Closed captions cleanup
2019-05-23 11:51:01 -03:00

29 lines
664 B
JavaScript

import Captions from '/imports/api/captions';
import Logger from '/imports/startup/server/logger';
import { check } from 'meteor/check';
export default function updateReadOnlyPadId(padId, readOnlyPadId) {
check(padId, String);
check(readOnlyPadId, String);
const selector = {
padId,
};
const modifier = {
$set: {
readOnlyPadId,
},
};
const cb = (err) => {
if (err) {
return Logger.error(`Adding readOnlyPadId captions pad: ${err}`);
}
return Logger.verbose(`Added readOnlyPadId captions pad=${padId} readOnlyPadId=${readOnlyPadId}`);
};
return Captions.update(selector, modifier, { multi: true }, cb);
}