7f926edfcc
Refactor the external videos collection, moving the logic and functionalities outside of /imports/api/meetings to a new location in /external-videos/server/modifiers in order to decrease the coupling between the functionalities, favoring the maintenance.
19 lines
680 B
JavaScript
19 lines
680 B
JavaScript
import { check } from 'meteor/check';
|
|
import Logger from '/imports/startup/server/logger';
|
|
import { ExternalVideoMeetings } from '/imports/api/meetings';
|
|
|
|
export default function startExternalVideo(meetingId, userId, externalVideoUrl) {
|
|
check(externalVideoUrl, String);
|
|
check(meetingId, String);
|
|
|
|
const selector = { meetingId };
|
|
const modifier = { $set: { externalVideoUrl } };
|
|
|
|
try {
|
|
ExternalVideoMeetings.update(selector, modifier);
|
|
Logger.info(`User id=${userId} sharing an external video: ${externalVideoUrl} for meeting ${meetingId}`);
|
|
} catch (err) {
|
|
Logger.error(`Error on setting shared external video start in Meetings collection: ${err}`);
|
|
}
|
|
}
|