Skip to content

Commit

Permalink
Fix non-iterable arg.filter.and
Browse files Browse the repository at this point in the history
  • Loading branch information
loicsaintroch committed Jul 29, 2024
1 parent 3fe7c40 commit cfd70b0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions services/libs/data-access-layer/src/activities/sql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,11 @@ export async function queryActivities(
}

// Delete empty arrays filtering conversationId.
for (const f of arg.filter.and) {
if (f.conversationId && f.conversationId.in && f.conversationId.in.length === 0) {
delete f.conversationId
if (arg.filter.and) {
for (const f of arg.filter.and) {
if (f.conversationId && f.conversationId.in && f.conversationId.in.length === 0) {
delete f.conversationId
}
}
}

Expand Down Expand Up @@ -531,7 +533,7 @@ export async function queryActivities(
}
}

const orderByString = parsedOrderBys.map((o) => `${o.column} ${o.direction}`).join(',')
const orderByString = parsedOrderBys.map((o) => `"${o.column}" ${o.direction}`).join(',')

const params: any = {
tenantId: arg.tenantId,
Expand Down

0 comments on commit cfd70b0

Please sign in to comment.