2018-05-12 00:01:24 +08:00
|
|
|
import { check } from 'meteor/check';
|
|
|
|
|
2022-05-04 20:40:56 +08:00
|
|
|
export default function addAnnotation(meetingId, whiteboardId, userId, annotation) {
|
|
|
|
check(meetingId, String);
|
|
|
|
check(whiteboardId, String);
|
|
|
|
check(annotation, Object);
|
2018-05-12 00:01:24 +08:00
|
|
|
|
|
|
|
const {
|
2022-05-04 20:40:56 +08:00
|
|
|
id, annotationInfo, wbId,
|
2018-05-12 00:01:24 +08:00
|
|
|
} = annotation;
|
|
|
|
|
|
|
|
const selector = {
|
|
|
|
meetingId,
|
|
|
|
id,
|
|
|
|
userId,
|
|
|
|
};
|
|
|
|
|
|
|
|
const modifier = {
|
|
|
|
$set: {
|
|
|
|
whiteboardId,
|
|
|
|
meetingId,
|
|
|
|
id,
|
|
|
|
annotationInfo,
|
|
|
|
wbId,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
return { selector, modifier };
|
|
|
|
}
|