Skip to content

Commit

Permalink
Fix type suggestions & add migrations for existing calls to mark them…
Browse files Browse the repository at this point in the history
… as inbound
  • Loading branch information
murtaza98 committed May 30, 2022
1 parent 761b8c3 commit 630ff22
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const CallTable: FC = () => {
const directoryRoute = useRoute('omnichannel-directory');

const resolveDirectionLabel = useCallback(
(direction: Nullable<IVoipRoom['direction']>) => {
(direction: IVoipRoom['direction']) => {
if (direction === 'inbound') {
return t('Incoming');
}
Expand Down
1 change: 1 addition & 0 deletions apps/meteor/server/startup/migrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,5 @@ import './v262';
import './v263';
import './v264';
import './v265';
import './v266';
import './xrun';
19 changes: 19 additions & 0 deletions apps/meteor/server/startup/migrations/v266.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { VoipRoom } from '../../../app/models/server/raw';
import { addMigration } from '../../lib/migrations';

addMigration({
version: 266,
async up() {
// mark all voip rooms as inbound which doesn't have any direction property set or has an invalid value
await VoipRoom.updateMany(
{
$or: [{ direction: { $exists: false } }, { direction: { $nin: ['inbound', 'outbound'] } }],
},
{
$set: {
direction: 'inbound',
},
},
);
},
});

0 comments on commit 630ff22

Please sign in to comment.