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( builder: args.knex.raw(
`CASE WHEN ${args.knex `CASE WHEN ${args.knex
.raw( .raw(
`${args.pt.arguments `${(
.map(async (ar) => await Promise.all(
(await args.fn(ar, '', 'OR')).builder.toQuery(), args.pt.arguments.map(async (ar) =>
(await args.fn(ar, '', 'OR')).builder.toQuery()
)
) )
.join(' OR ')}`, ).join(' OR ')}`
) )
.wrap('(', ')') .wrap('(', ')')
.toQuery()} THEN TRUE ELSE FALSE END ${args.colAlias}`, .toQuery()} THEN TRUE ELSE FALSE END ${args.colAlias}`
), ),
}; };
}, },

Loading…
Cancel
Save