Browse Source

fix(nocodb): incorrect OR builder

pull/5472/head
Wing-Kam Wong 2 years ago
parent
commit
b594c5a035
  1. 10
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/functionMappings/pg.ts

10
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/functionMappings/pg.ts

@ -157,11 +157,13 @@ const pg = {
builder: args.knex.raw(
`CASE WHEN ${args.knex
.raw(
`${args.pt.arguments
.map(async (ar) =>
(await args.fn(ar, '', 'OR')).builder.toQuery()
`${(
await Promise.all(
args.pt.arguments.map(async (ar) =>
(await args.fn(ar, '', 'OR')).builder.toQuery()
)
)
.join(' OR ')}`
).join(' OR ')}`
)
.wrap('(', ')')
.toQuery()} THEN TRUE ELSE FALSE END ${args.colAlias}`

Loading…
Cancel
Save