2019-04-06 06:32:21 +08:00
|
|
|
import UserInfos from '/imports/api/users-infos';
|
|
|
|
import Logger from '/imports/startup/server/logger';
|
|
|
|
|
|
|
|
export default function addUserInfo(userInfo, requesterUserId, meetingId) {
|
|
|
|
const info = {
|
|
|
|
meetingId,
|
|
|
|
requesterUserId,
|
|
|
|
userInfo,
|
|
|
|
};
|
2019-04-12 04:54:15 +08:00
|
|
|
const cb = (err) => {
|
2019-04-06 06:32:21 +08:00
|
|
|
if (err) {
|
|
|
|
return Logger.error(`Adding user information to collection: ${err}`);
|
|
|
|
}
|
|
|
|
return Logger.info(`Added user information: requester id=${requesterUserId} meeting=${meetingId}`);
|
|
|
|
};
|
|
|
|
|
|
|
|
return UserInfos.insert(info, cb);
|
|
|
|
}
|