2020-04-26 03:03:35 +08:00
|
|
|
import { check } from 'meteor/check';
|
|
|
|
import updateTimer from '/imports/api/timer/server/modifiers/updateTimer';
|
|
|
|
import { extractCredentials } from '/imports/api/common/server/helpers';
|
|
|
|
|
|
|
|
export default function switchTimer(stopwatch) {
|
|
|
|
check(stopwatch, Boolean);
|
|
|
|
|
2022-07-14 00:59:02 +08:00
|
|
|
const { meetingId, requesterUserId } = extractCredentials(this.userId);
|
2020-04-26 03:03:35 +08:00
|
|
|
check(meetingId, String);
|
2022-07-14 00:59:02 +08:00
|
|
|
check(requesterUserId, String);
|
2020-04-26 03:03:35 +08:00
|
|
|
|
2022-08-31 22:46:03 +08:00
|
|
|
updateTimer({
|
|
|
|
action: 'switch',
|
|
|
|
meetingId,
|
|
|
|
requesterUserId,
|
|
|
|
stopwatch,
|
|
|
|
});
|
2020-04-26 03:03:35 +08:00
|
|
|
}
|