bigbluebutton-Github/bigbluebutton-html5/imports/api/shapes/server/modifiers/removeShapeFromSlide.js

23 lines
743 B
JavaScript
Raw Normal View History

2016-05-13 01:43:59 +08:00
import Shapes from '/imports/api/shapes/collection';
import { logger } from '/imports/startup/server/logger';
export function removeShapeFromSlide(meetingId, whiteboardId, shapeId) {
let shapeToRemove;
if (meetingId != null && whiteboardId != null && shapeId != null) {
shapeToRemove = Shapes.findOne({
meetingId: meetingId,
whiteboardId: whiteboardId,
'shape.id': shapeId,
});
if (shapeToRemove != null) {
Shapes.remove(shapeToRemove._id);
logger.info(`----removed shape[${shapeId}] from ${whiteboardId}`);
return logger.info(`remaining shapes on the slide: ${
Shapes.find({
meetingId: meetingId,
whiteboardId: whiteboardId,
}).count()}`);
}
}
};