bigbluebutton-Github/bigbluebutton-html5/imports/api/annotations/server/methods/sendBulkAnnotations.js
2021-05-04 11:38:56 -03:00

20 lines
673 B
JavaScript

import { extractCredentials } from '/imports/api/common/server/helpers';
import sendAnnotationHelper from './sendAnnotationHelper';
import { check } from 'meteor/check';
import Logger from '/imports/startup/server/logger';
export default function sendBulkAnnotations(payload) {
const { meetingId, requesterUserId } = extractCredentials(this.userId);
try {
check(meetingId, String);
check(requesterUserId, String);
payload.forEach((annotation) => sendAnnotationHelper(annotation, meetingId, requesterUserId));
return true;
} catch (err) {
Logger.error(`Exception while invoking method sendBulkAnnotations ${err.stack}`);
return false;
}
}