Skip to content

Commit

Permalink
Fix improper model usage
Browse files Browse the repository at this point in the history
  • Loading branch information
KevLehman committed Nov 24, 2022
1 parent c47c16f commit 0813fd4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions apps/meteor/ee/app/livechat-enterprise/server/lib/Helper.js
Expand Up @@ -8,7 +8,7 @@ import {
} from '@rocket.chat/models';

import { memoizeDebounce } from './debounceByParams';
import { Users, LivechatInquiry, LivechatRooms, Messages } from '../../../../../app/models/server';
import { Users, LivechatInquiry, Messages } from '../../../../../app/models/server';
import { settings } from '../../../../../app/settings/server';
import { RoutingManager } from '../../../../../app/livechat/server/lib/RoutingManager';
import { dispatchAgentDelegated } from '../../../../../app/livechat/server/lib/Helper';
Expand Down Expand Up @@ -247,11 +247,10 @@ export const updateSLAInquiries = async (sla) => {
}

const { _id: slaId } = sla;
await Promise.allSettled(
LivechatRooms.findOpenBySlaId(slaId).forEach((room) => {
updateInquiryQueueSla(room._id, sla);
}),
);
const promises = LivechatRoomsRaw.findOpenBySlaId(slaId).forEach((room) => {
updateInquiryQueueSla(room._id, sla);
});
await Promise.allSettled(promises.length ? promises : []);
};

export const getLivechatCustomFields = async () => {
Expand Down

0 comments on commit 0813fd4

Please sign in to comment.