Skip to content
Snippets Groups Projects
Commit 4fe83bf7 authored by Oswaldo Acauan's avatar Oswaldo Acauan
Browse files

Refactor Shapes API

parent b0e784ec
No related branches found
No related tags found
No related merge requests found
import Logger from '/imports/startup/server/logger';
import { check } from 'meteor/check';
import removePresentation from '../modifiers/removePresentation';
import addShape from '../modifiers/addShape';
export default function handleWhiteboardSend({ payload }) {
const meetingId = payload.meeting_id;
......
......@@ -5,9 +5,6 @@ import Logger from '/imports/startup/server/logger';
const SHAPE_TYPE_TEXT = 'text';
const SHAPE_TYPE_POLL_RESULT = 'poll_result';
const SHAPE_STATUS_START = 'status';
const SHAPE_STATUS_START = 'status';
export default function addShape(meetingId, whiteboardId, shape) {
check(meetingId, String);
check(whiteboardId, String);
......@@ -74,8 +71,6 @@ export default function addShape(meetingId, whiteboardId, shape) {
return Logger.error(`Adding shape to collection: ${err}`);
}
addSlides(meetingId, shape.id, shape.pages);
const { insertedId } = numChanged;
if (insertedId) {
return Logger.info(`Added shape id=${shape.id} whiteboard=${whiteboardId}`);
......
......@@ -3,7 +3,7 @@ import Logger from '/imports/startup/server/logger';
export default function clearShapes(meetingId) {
if (meetingId) {
return Shapes.remove({ meetingId: meetingId, }, Logger.info(`Cleared Shapes (${meetingId})`));
return Shapes.remove({ meetingId, }, Logger.info(`Cleared Shapes (${meetingId})`));
}
return Shapes.remove({}, Logger.info('Cleared Shapes (all)'));
......
......@@ -16,7 +16,7 @@ export default function clearShapesWhiteboard(meetingId, whiteboardId) {
return Logger.error(`Removing Shapes from collection: ${err}`);
}
return Logger.info(`Removed Shapes where whiteboardId=${presentationId}`);
return Logger.info(`Removed Shapes where whiteboard=${whiteboardId}`);
};
return Shapes.remove(selector, cb);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment