23 lines
739 B
JavaScript
23 lines
739 B
JavaScript
import RedisPubSub from '/imports/startup/server/redis';
|
|
import { Meteor } from 'meteor/meteor';
|
|
import { check } from 'meteor/check';
|
|
import { extractCredentials } from '/imports/api/common/server/helpers';
|
|
|
|
export default function changeWhiteboardAccess(multiUser, whiteboardId) {
|
|
const REDIS_CONFIG = Meteor.settings.private.redis;
|
|
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
|
|
const EVENT_NAME = 'ModifyWhiteboardAccessPubMsg';
|
|
|
|
const { meetingId, requesterUserId } = extractCredentials(this.userId);
|
|
|
|
check(multiUser, Boolean);
|
|
check(whiteboardId, String);
|
|
|
|
const payload = {
|
|
multiUser,
|
|
whiteboardId,
|
|
};
|
|
|
|
return RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload);
|
|
}
|