2021-03-17 00:15:41 +08:00
|
|
|
import { check } from 'meteor/check';
|
2020-02-07 04:47:28 +08:00
|
|
|
import sendAnnotationHelper from './sendAnnotationHelper';
|
|
|
|
import { extractCredentials } from '/imports/api/common/server/helpers';
|
2021-05-04 22:38:56 +08:00
|
|
|
import Logger from '/imports/startup/server/logger';
|
2017-05-02 05:34:24 +08:00
|
|
|
|
2020-02-07 04:47:28 +08:00
|
|
|
export default function sendAnnotation(annotation) {
|
2021-05-04 22:38:56 +08:00
|
|
|
try {
|
|
|
|
const { meetingId, requesterUserId } = extractCredentials(this.userId);
|
2018-08-01 21:21:33 +08:00
|
|
|
|
2021-05-04 22:38:56 +08:00
|
|
|
check(meetingId, String);
|
|
|
|
check(requesterUserId, String);
|
2021-03-17 00:15:41 +08:00
|
|
|
|
2021-05-04 22:38:56 +08:00
|
|
|
sendAnnotationHelper(annotation, meetingId, requesterUserId);
|
|
|
|
} catch (err) {
|
|
|
|
Logger.error(`Exception while invoking method sendAnnotation ${err.stack}`);
|
|
|
|
}
|
2017-05-02 05:34:24 +08:00
|
|
|
}
|