2021-10-20 04:35:39 +08:00
|
|
|
import Users from '/imports/api/users';
|
2020-06-26 20:45:03 +08:00
|
|
|
import Auth from '/imports/ui/services/auth';
|
2021-10-20 04:35:39 +08:00
|
|
|
import Meetings from '/imports/api/meetings';
|
2020-06-26 20:45:03 +08:00
|
|
|
|
2021-01-21 04:49:07 +08:00
|
|
|
const getMeetingTitle = () => {
|
|
|
|
const meeting = Meetings.findOne({
|
|
|
|
meetingId: Auth.meetingID,
|
|
|
|
}, { fields: { 'meetingProp.name': 1, 'breakoutProps.sequence': 1 } });
|
|
|
|
|
|
|
|
return meeting.meetingProp.name;
|
|
|
|
};
|
|
|
|
|
2020-06-26 20:45:03 +08:00
|
|
|
const getUsers = () => {
|
2021-01-23 03:48:50 +08:00
|
|
|
const numUsers = Users.find({
|
|
|
|
meetingId: Auth.meetingID,
|
2021-03-09 02:11:31 +08:00
|
|
|
userId: { $ne: Auth.userID },
|
2021-01-23 03:48:50 +08:00
|
|
|
}, { fields: { _id: 1 } }).count();
|
2020-06-26 20:45:03 +08:00
|
|
|
|
2021-01-23 03:48:50 +08:00
|
|
|
return numUsers;
|
2020-06-26 20:45:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
export default {
|
|
|
|
getUsers,
|
2021-01-21 04:49:07 +08:00
|
|
|
getMeetingTitle,
|
2021-01-23 03:48:50 +08:00
|
|
|
};
|