28 lines
661 B
JavaScript
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}`);
|
|
}
|
|
}
|