2020-04-07 04:34:08 +08:00
|
|
|
import { Annotations, UnsentAnnotations } from '/imports/ui/components/whiteboard/service';
|
2017-07-27 20:35:55 +08:00
|
|
|
|
2017-08-26 06:45:06 +08:00
|
|
|
const getCurrentAnnotationsInfo = (whiteboardId) => {
|
2017-07-27 20:35:55 +08:00
|
|
|
if (!whiteboardId) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2017-08-26 06:45:06 +08:00
|
|
|
return Annotations.find(
|
|
|
|
{
|
|
|
|
whiteboardId,
|
2020-04-07 04:34:08 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
sort: { position: 1 },
|
|
|
|
fields: { status: 1, _id: 1, annotationType: 1 },
|
|
|
|
},
|
|
|
|
).fetch();
|
|
|
|
};
|
|
|
|
|
|
|
|
const getUnsetAnnotations = (whiteboardId) => {
|
|
|
|
if (!whiteboardId) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return UnsentAnnotations.find(
|
|
|
|
{
|
|
|
|
whiteboardId,
|
2017-08-26 06:45:06 +08:00
|
|
|
},
|
|
|
|
{
|
2017-10-10 09:30:29 +08:00
|
|
|
sort: { position: 1 },
|
2017-08-26 06:45:06 +08:00
|
|
|
fields: { status: 1, _id: 1, annotationType: 1 },
|
|
|
|
},
|
|
|
|
).fetch();
|
2017-07-27 20:35:55 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
export default {
|
2017-08-26 06:45:06 +08:00
|
|
|
getCurrentAnnotationsInfo,
|
2020-04-07 04:34:08 +08:00
|
|
|
getUnsetAnnotations,
|
2017-07-27 20:35:55 +08:00
|
|
|
};
|