Browse Source

fix: incorrect OR builder

pull/5444/head
Wing-Kam Wong 2 years ago
parent
commit
2a61396439
  1. 12
      packages/nocodb-nest/src/db/functionMappings/pg.ts

12
packages/nocodb-nest/src/db/functionMappings/pg.ts

@ -157,14 +157,16 @@ 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}`,
.toQuery()} THEN TRUE ELSE FALSE END ${args.colAlias}`
),
};
},

Loading…
Cancel
Save