From dc50515bcc16ed0935fd8bd4a1c04feb729758d9 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 6 Oct 2023 12:16:37 +0100 Subject: [PATCH] Adding negative test case and fixing build issue. --- packages/server/src/sdk/app/rows/search/tests/utils.spec.ts | 5 ++++- packages/server/src/sdk/app/rows/search/utils.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/server/src/sdk/app/rows/search/tests/utils.spec.ts b/packages/server/src/sdk/app/rows/search/tests/utils.spec.ts index 01db0d421b..a1cb4fe48d 100644 --- a/packages/server/src/sdk/app/rows/search/tests/utils.spec.ts +++ b/packages/server/src/sdk/app/rows/search/tests/utils.spec.ts @@ -37,13 +37,16 @@ describe("searchInputMapping", () => { }) it("shouldn't change any other input", () => { + const email = "test@test.com" const params: SearchParams = { tableId, query: { equal: { - "1:user": "test@test.com", + "1:user": email, }, }, } + const output = searchInputMapping(tableWithUserCol, params) + expect(output.query.equal!["1:user"]).toBe(email) }) }) diff --git a/packages/server/src/sdk/app/rows/search/utils.ts b/packages/server/src/sdk/app/rows/search/utils.ts index c86df9bc0d..5afa13c53d 100644 --- a/packages/server/src/sdk/app/rows/search/utils.ts +++ b/packages/server/src/sdk/app/rows/search/utils.ts @@ -11,7 +11,7 @@ import { db as dbCore } from "@budibase/backend-core" function findColumnInQueries( column: string, options: SearchParams, - callback: (filter: T) => T + callback: (filter: any) => any ) { for (let filterBlock of Object.values(options.query)) { if (typeof filterBlock !== "object") {