Skip to content

Commit

Permalink
return inq
Browse files Browse the repository at this point in the history
  • Loading branch information
KevLehman committed Oct 25, 2024
1 parent 6592600 commit 72d747b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions apps/meteor/app/livechat/server/lib/QueueManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ export class QueueManager {

const inquiryAgent = await RoutingManager.delegateAgent(defaultAgent, inquiry);
logger.debug(`Delegating inquiry with id ${inquiry._id} to agent ${defaultAgent?.username}`);
await callbacks.run('livechat.beforeRouteChat', inquiry, inquiryAgent);
const dbInquiry = await LivechatInquiry.findOneById(inquiry._id);
const dbInquiry = await callbacks.run('livechat.beforeRouteChat', inquiry, inquiryAgent);

if (!dbInquiry) {
throw new Error('inquiry-not-found');
Expand Down Expand Up @@ -151,8 +150,7 @@ export class QueueManager {
return;
}

await callbacks.run('livechat.beforeRouteChat', inquiry, defaultAgent);
const dbInquiry = await LivechatInquiry.findOneById(inquiry._id);
const dbInquiry = await callbacks.run('livechat.beforeRouteChat', inquiry, defaultAgent);

if (!dbInquiry) {
throw new Error('inquiry-not-found');
Expand Down

0 comments on commit 72d747b

Please sign in to comment.