From a836994218134397652b55a59e7ebacd412075a8 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 22 Nov 2023 07:17:55 +0000 Subject: [PATCH] fix: add TRUE/FALSE method support --- packages/nocodb/src/db/functionMappings/commonFns.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/nocodb/src/db/functionMappings/commonFns.ts b/packages/nocodb/src/db/functionMappings/commonFns.ts index 006a899bae..19e2a4be24 100644 --- a/packages/nocodb/src/db/functionMappings/commonFns.ts +++ b/packages/nocodb/src/db/functionMappings/commonFns.ts @@ -53,8 +53,6 @@ export default { } return { builder: args.knex.raw(`CASE ${query}\n END${args.colAlias}`) }; }, - TRUE: 1, - FALSE: 0, AND: async (args: MapFnArgs) => { return { builder: args.knex.raw( @@ -112,8 +110,13 @@ export default { builder: (await args.fn(args.pt?.arguments?.[0])).builder.wrap('(', ')'), }; }, - BLANK: async (args: MapFnArgs) => { return { builder: args.knex.raw(`?`, ['']) }; }, + TRUE: async (args: MapFnArgs) => { + return { builder: args.knex.raw(`?`, [1]) }; + }, + FALSE: async (args: MapFnArgs) => { + return { builder: args.knex.raw(`?`, [0]) }; + }, };