2019-02-27 01:08:15 +08:00
|
|
|
import { check } from 'meteor/check';
|
|
|
|
import setGuestStatus from '../modifiers/setGuestStatus';
|
|
|
|
|
2023-03-09 01:35:40 +08:00
|
|
|
export default async 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
|
|
|
|
2023-03-09 01:35:40 +08:00
|
|
|
const result = await Promise.all(guests.map(async (guest) => {
|
|
|
|
const a = await setGuestStatus(meetingId, guest.guest, guest.status, approvedBy);
|
|
|
|
return a;
|
|
|
|
}));
|
|
|
|
return result;
|
2019-02-27 01:08:15 +08:00
|
|
|
}
|