2019-02-27 01:08:15 +08:00
|
|
|
import { check } from 'meteor/check';
|
|
|
|
import setGuestStatus from '../modifiers/setGuestStatus';
|
|
|
|
|
2019-04-05 21:52:13 +08:00
|
|
|
export default function handleGuestApproved({ body }, meetingId) {
|
2019-04-05 21:18:24 +08:00
|
|
|
const { approvedBy, guests } = body;
|
2019-02-27 01:08:15 +08:00
|
|
|
check(meetingId, String);
|
|
|
|
check(approvedBy, String);
|
2019-04-05 21:18:24 +08:00
|
|
|
check(guests, Array);
|
2019-02-27 01:08:15 +08:00
|
|
|
|
|
|
|
return guests.forEach(guest => setGuestStatus(meetingId, guest.guest, guest.status, approvedBy));
|
|
|
|
}
|