RocketChat/Rocket.Chat

View on GitHub
apps/meteor/server/startup/migrations/v282.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { Settings } from '@rocket.chat/models';

import { settings } from '../../../app/settings/server';
import { addMigration } from '../../lib/migrations';

addMigration({
    version: 282,
    async up() {
        const omnichannelCallProvider = settings.get('Omnichannel_call_provider');
        if (omnichannelCallProvider !== 'none') {
            await Settings.updateOne(
                { _id: 'Omnichannel_call_provider' },
                {
                    $set: { value: 'default-provider' },
                },
                { upsert: true },
            );
        }
    },
});