Skip to content

Commit

Permalink
[FIX] User's with non-agent role shown on voip agent association model (
Browse files Browse the repository at this point in the history
  • Loading branch information
murtaza98 committed Jun 1, 2022
1 parent c8fba6f commit db257d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/meteor/app/api/server/v1/voip/omnichannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ API.v1.addRoute(
}

if (!user) {
return API.v1.notFound();
return API.v1.notFound('User not found or does not have livechat-agent role');
}

try {
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/models/server/raw/Users.js
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ export class UsersRaw extends BaseRaw {

getAvailableAgentsIncludingExt(includeExt, text, options) {
const query = {
roles: { $in: ['livechat-agent', 'livechat-manager', 'livechat-monitor'] },
roles: { $in: ['livechat-agent'] },
$and: [
...(text && text.trim()
? [{ $or: [{ username: new RegExp(escapeRegExp(text), 'i') }, { name: new RegExp(escapeRegExp(text), 'i') }] }]
Expand Down

0 comments on commit db257d3

Please sign in to comment.