bigbluebutton-Github/bigbluebutton-html5/imports/api/annotations/server/handlers/whiteboardAnnotations.js
2017-10-11 18:09:35 -07:00

23 lines
659 B
JavaScript

import _ from 'lodash';
import { check } from 'meteor/check';
import clearAnnotations from '../modifiers/clearAnnotations';
import addAnnotation from '../modifiers/addAnnotation';
export default function handleWhiteboardAnnotations({ body }, meetingId) {
check(meetingId, String);
check(body, Object);
const { annotations, whiteboardId } = body;
check(whiteboardId, String);
clearAnnotations(meetingId, whiteboardId);
const annotationsAdded = [];
_.each(annotations, (annotation) => {
const { wbId, userId } = annotation;
annotationsAdded.push(addAnnotation(meetingId, wbId, userId, annotation));
});
return annotationsAdded;
}