2020-02-07 04:47:28 +08:00
|
|
|
import { extractCredentials } from '/imports/api/common/server/helpers';
|
|
|
|
import sendAnnotationHelper from './sendAnnotationHelper';
|
2021-03-17 00:15:41 +08:00
|
|
|
import { check } from 'meteor/check';
|
2021-05-04 22:38:56 +08:00
|
|
|
import Logger from '/imports/startup/server/logger';
|
2019-02-14 00:15:09 +08:00
|
|
|
|
2020-02-07 04:47:28 +08:00
|
|
|
export default function sendBulkAnnotations(payload) {
|
|
|
|
const { meetingId, requesterUserId } = extractCredentials(this.userId);
|
2019-02-14 00:15:09 +08:00
|
|
|
|
2021-03-25 20:47:57 +08:00
|
|
|
try {
|
|
|
|
check(meetingId, String);
|
|
|
|
check(requesterUserId, String);
|
2021-05-04 22:38:56 +08:00
|
|
|
|
|
|
|
payload.forEach((annotation) => sendAnnotationHelper(annotation, meetingId, requesterUserId));
|
|
|
|
return true;
|
2021-03-25 20:47:57 +08:00
|
|
|
} catch (err) {
|
2021-05-04 22:38:56 +08:00
|
|
|
Logger.error(`Exception while invoking method sendBulkAnnotations ${err.stack}`);
|
2021-03-25 20:47:57 +08:00
|
|
|
return false;
|
|
|
|
}
|
2019-02-14 00:15:09 +08:00
|
|
|
}
|