2017-10-07 02:12:33 +08:00
|
|
|
import { check } from 'meteor/check';
|
2017-10-26 01:29:03 +08:00
|
|
|
import changeRole from '/imports/api/users/server/modifiers/changeRole';
|
2017-08-19 02:23:05 +08:00
|
|
|
|
2023-03-15 21:18:31 +08:00
|
|
|
export default async function handleChangeRole(payload, meetingId) {
|
2017-10-10 23:05:16 +08:00
|
|
|
check(payload.body, Object);
|
2017-10-07 02:12:33 +08:00
|
|
|
check(meetingId, String);
|
|
|
|
|
2017-10-26 01:29:03 +08:00
|
|
|
const { userId, role, changedBy } = payload.body;
|
|
|
|
|
2023-03-15 21:18:31 +08:00
|
|
|
await changeRole(role, userId, meetingId, changedBy);
|
2017-08-19 02:23:05 +08:00
|
|
|
}
|