bigbluebutton-Github/bigbluebutton-html5/imports/api/meetings/server/handlers/timeRemainingUpdate.js
Tainan Felipe 80a8d29113 Fix typo
2019-09-09 11:48:50 -03:00

31 lines
634 B
JavaScript

import { check } from 'meteor/check';
import { MeetingTimeRemaining } from '/imports/api/meetings';
import Logger from '/imports/startup/server/logger';
export default function handleTimeRemainingUpdate({ body }, meetingId) {
check(meetingId, String);
check(body, {
timeLeftInSec: Number,
});
const { timeLeftInSec } = body;
const selector = {
meetingId,
};
const modifier = {
$set: {
timeRemaining: timeLeftInSec,
},
};
const cb = (err) => {
if (err) {
Logger.error(`Changing recording time: ${err}`);
}
};
return MeetingTimeRemaining.upsert(selector, modifier, cb);
}