Skip to content

Commit

Permalink
Apply CRS
Browse files Browse the repository at this point in the history
  • Loading branch information
murtaza98 committed May 27, 2022
1 parent b16f9ac commit 214d811
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions apps/meteor/app/api/server/v1/voip/rooms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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 }));
Expand Down
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: Partial<IVoipRoom['direction']>) => {
(direction: Nullable<IVoipRoom['direction']>) => {
if (direction === 'inbound') {
return t('Incoming');
}
Expand Down

0 comments on commit 214d811

Please sign in to comment.