2019-04-06 06:32:21 +08:00
|
|
|
import UserInfos from '/imports/api/users-infos';
|
|
|
|
import Logger from '/imports/startup/server/logger';
|
|
|
|
|
2023-04-01 04:40:41 +08:00
|
|
|
export default async function addUserInfo(userInfo, requesterUserId, meetingId) {
|
2019-04-06 06:32:21 +08:00
|
|
|
const info = {
|
|
|
|
meetingId,
|
|
|
|
requesterUserId,
|
|
|
|
userInfo,
|
|
|
|
};
|
|
|
|
|
2020-11-27 00:23:57 +08:00
|
|
|
try {
|
2023-04-01 04:40:41 +08:00
|
|
|
const numberAffected = await UserInfos.insertAsync(info);
|
2020-11-27 00:23:57 +08:00
|
|
|
|
|
|
|
if (numberAffected) {
|
|
|
|
Logger.info(`Added user information: requester id=${requesterUserId} meeting=${meetingId}`);
|
|
|
|
}
|
|
|
|
} catch (err) {
|
|
|
|
Logger.error(`Adding user information to collection: ${err}`);
|
|
|
|
}
|
2019-04-06 06:32:21 +08:00
|
|
|
}
|