2022-04-14 21:59:54 +08:00
|
|
|
import Logger from '/imports/startup/server/logger';
|
|
|
|
import Users from '/imports/api/users';
|
|
|
|
|
2023-04-01 04:40:41 +08:00
|
|
|
export default async function updateSpeechLocale(meetingId, userId, locale) {
|
2022-04-14 21:59:54 +08:00
|
|
|
const selector = {
|
|
|
|
meetingId,
|
|
|
|
userId,
|
|
|
|
};
|
|
|
|
|
|
|
|
const modifier = {
|
|
|
|
$set: {
|
|
|
|
speechLocale: locale,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
try {
|
2023-04-01 04:40:41 +08:00
|
|
|
const numberAffected = await Users.updateAsync(selector, modifier);
|
2022-04-14 21:59:54 +08:00
|
|
|
|
|
|
|
if (numberAffected) {
|
|
|
|
Logger.info(`Updated speech locale=${locale} userId=${userId} meetingId=${meetingId}`);
|
|
|
|
}
|
|
|
|
} catch (err) {
|
|
|
|
Logger.error(`Updating speech locale: ${err}`);
|
|
|
|
}
|
|
|
|
}
|