bigbluebutton-Github/bigbluebutton-html5/imports/api/pads/server/modifiers/tailPad.js
2023-03-20 16:38:31 -03:00

28 lines
661 B
JavaScript

import { check } from 'meteor/check';
import { PadsUpdates } from '/imports/api/pads';
import Logger from '/imports/startup/server/logger';
export default async function tailPad(meetingId, externalId, tail) {
try {
check(meetingId, String);
check(externalId, String);
check(tail, String);
const selector = {
meetingId,
externalId,
};
const modifier = {
$set: {
tail,
},
};
await PadsUpdates.upsertAsync(selector, modifier);
Logger.debug(`Added pad tail external=${externalId} meeting=${meetingId}`);
} catch (err) {
Logger.error(`Adding pad tail to the collection: ${err}`);
}
}