Skip to content

Commit 7390281

Browse files
feat(OUT-2888): remove current portal id when quering logs table to get incorrect sync in response
1 parent b45c673 commit 7390281

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/app/api/quickbooks/portalImpactVerification-temp/checkPortalInvoice.service.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Intuit from '@/utils/intuit'
1616
import CustomLogger from '@/utils/logger'
1717
import { captureMessage } from '@sentry/nextjs'
1818
import dayjs from 'dayjs'
19-
import { and, eq, inArray, SQL } from 'drizzle-orm'
19+
import { and, eq, inArray, ne, SQL } from 'drizzle-orm'
2020
import httpStatus from 'http-status'
2121

2222
type InvoiceResponseType = {
@@ -303,7 +303,11 @@ export class CheckPortalInvoiceService extends BaseService {
303303
}
304304

305305
const syncLogs = await this.db.query.QBSyncLog.findMany({
306-
where: (logs) => inArray(logs.invoiceNumber, invoiceNumbers),
306+
where: (logs) =>
307+
and(
308+
inArray(logs.invoiceNumber, invoiceNumbers),
309+
ne(logs.portalId, portalId),
310+
),
307311
columns: {
308312
portalId: true,
309313
invoiceNumber: true,

0 commit comments

Comments
 (0)