2019-05-17 04:11:10 +08:00
|
|
|
import { check } from 'meteor/check';
|
|
|
|
import Captions from '/imports/api/captions';
|
|
|
|
import updateOwnerId from '/imports/api/captions/server/modifiers/updateOwnerId';
|
2020-02-07 04:47:28 +08:00
|
|
|
import { extractCredentials } from '/imports/api/common/server/helpers';
|
2021-05-05 01:34:31 +08:00
|
|
|
import Logger from '/imports/startup/server/logger';
|
2019-05-17 04:11:10 +08:00
|
|
|
|
2020-02-07 04:47:28 +08:00
|
|
|
export default function takeOwnership(locale) {
|
2021-05-05 01:34:31 +08:00
|
|
|
try {
|
|
|
|
const { meetingId, requesterUserId } = extractCredentials(this.userId);
|
2019-05-17 04:11:10 +08:00
|
|
|
|
2021-05-05 01:34:31 +08:00
|
|
|
check(locale, String);
|
2021-10-05 01:35:53 +08:00
|
|
|
check(meetingId, String);
|
|
|
|
check(requesterUserId, String);
|
2019-05-17 04:11:10 +08:00
|
|
|
|
2021-10-05 01:35:53 +08:00
|
|
|
updateOwnerId(meetingId, requesterUserId, locale);
|
2021-05-05 01:34:31 +08:00
|
|
|
} catch (err) {
|
|
|
|
Logger.error(`Exception while invoking method takeOwnership ${err.stack}`);
|
2019-05-17 04:11:10 +08:00
|
|
|
}
|
|
|
|
}
|