diff --git a/apps/meteor/app/api/server/v1/voip/rooms.ts b/apps/meteor/app/api/server/v1/voip/rooms.ts index a8077ab51182..498d246712a7 100644 --- a/apps/meteor/app/api/server/v1/voip/rooms.ts +++ b/apps/meteor/app/api/server/v1/voip/rooms.ts @@ -89,7 +89,7 @@ API.v1.addRoute( token: String, agentId: Match.Maybe(String), rid: Match.Maybe(String), - direction: Match.Maybe(String), + direction: Match.Maybe(Match.Where((value: string) => ['inbound', 'outbound'].includes(value))), }; check(this.queryParams, defaultCheckParams); @@ -116,8 +116,8 @@ API.v1.addRoute( const agent = { agentId: _id, username }; const rid = Random.id(); - if (direction !== 'inbound' && direction !== 'outbound') { - return API.v1.failure('invalid-direction'); + if (!direction) { + return API.v1.failure('no-direction-provided-for-new-room'); } return API.v1.success(await LivechatVoip.getNewRoom(guest, agent, rid, direction, { projection: API.v1.defaultFieldsToExclude })); diff --git a/apps/meteor/client/views/omnichannel/directory/calls/CallTable.tsx b/apps/meteor/client/views/omnichannel/directory/calls/CallTable.tsx index 793ca4ecdb3d..f7bf171e9249 100644 --- a/apps/meteor/client/views/omnichannel/directory/calls/CallTable.tsx +++ b/apps/meteor/client/views/omnichannel/directory/calls/CallTable.tsx @@ -56,7 +56,7 @@ const CallTable: FC = () => { const directoryRoute = useRoute('omnichannel-directory'); const resolveDirectionLabel = useCallback( - (direction: Partial) => { + (direction: Nullable) => { if (direction === 'inbound') { return t('Incoming'); }