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

28 lines
663 B
JavaScript
Raw Normal View History

2016-11-19 01:35:28 +08:00
import { check } from 'meteor/check';
import Shapes from '/imports/api/shapes';
import Logger from '/imports/startup/server/logger';
export default function removeShape(meetingId, whiteboardId, shapeId) {
check(meetingId, String);
check(whiteboardId, String);
check(shapeId, String);
const selector = {
meetingId,
whiteboardId,
'shape.id': shapeId,
};
const cb = (err, numChanged) => {
if (err) {
return Logger.error(`Removing shape from collection: ${err}`);
}
if (numChanged) {
return Logger.info(`Removed shape id=${shapeId} whiteboard=${whiteboardId}`);
}
};
return Shapes.remove(selector, cb);
};