Clear meeting-time-remaining collection
This commit is contained in:
parent
811d6d3f98
commit
3d78045363
@ -0,0 +1,26 @@
|
||||
import { MeetingTimeRemaining } from '/imports/api/meetings';
|
||||
import Logger from '/imports/startup/server/logger';
|
||||
|
||||
export default function clearMeetingTimeRemaining(meetingId) {
|
||||
if (meetingId) {
|
||||
try {
|
||||
const numberAffected = MeetingTimeRemaining.remove({ meetingId });
|
||||
|
||||
if (numberAffected) {
|
||||
Logger.info(`Cleared MeetingTimeRemaining in (${meetingId})`);
|
||||
}
|
||||
} catch (err) {
|
||||
Logger.info(`Error on clearing MeetingTimeRemaining in (${meetingId}). ${err}`);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
const numberAffected = MeetingTimeRemaining.remove({});
|
||||
|
||||
if (numberAffected) {
|
||||
Logger.info('Cleared MeetingTimeRemaining in all meetings');
|
||||
}
|
||||
} catch (err) {
|
||||
Logger.error(`Error on clearing MeetingTimeRemaining in all meetings. ${err}`);
|
||||
}
|
||||
}
|
||||
}
|
@ -20,6 +20,7 @@ import clearUserInfo from '/imports/api/users-infos/server/modifiers/clearUserIn
|
||||
import clearConnectionStatus from '/imports/api/connection-status/server/modifiers/clearConnectionStatus';
|
||||
import clearNote from '/imports/api/note/server/modifiers/clearNote';
|
||||
import clearNetworkInformation from '/imports/api/network-information/server/modifiers/clearNetworkInformation';
|
||||
import clearMeetingTimeRemaining from '/imports/api/meetings/server/modifiers/clearMeetingTimeRemaining';
|
||||
import clearLocalSettings from '/imports/api/local-settings/server/modifiers/clearLocalSettings';
|
||||
import clearRecordMeeting from './clearRecordMeeting';
|
||||
import clearVoiceCallStates from '/imports/api/voice-call-states/server/modifiers/clearVoiceCallStates';
|
||||
@ -49,6 +50,7 @@ export default function meetingHasEnded(meetingId) {
|
||||
clearNote(meetingId);
|
||||
clearNetworkInformation(meetingId);
|
||||
clearLocalSettings(meetingId);
|
||||
clearMeetingTimeRemaining(meetingId);
|
||||
clearRecordMeeting(meetingId);
|
||||
clearVoiceCallStates(meetingId);
|
||||
clearVideoStreams(meetingId);
|
||||
|
Loading…
Reference in New Issue
Block a user