Adding negative test case and fixing build issue.

This commit is contained in:
mike12345567 2023-10-06 12:16:37 +01:00
parent 3de8c53166
commit dc50515bcc
2 changed files with 5 additions and 2 deletions

View File

@ -37,13 +37,16 @@ describe("searchInputMapping", () => {
}) })
it("shouldn't change any other input", () => { it("shouldn't change any other input", () => {
const email = "test@test.com"
const params: SearchParams = { const params: SearchParams = {
tableId, tableId,
query: { query: {
equal: { equal: {
"1:user": "test@test.com", "1:user": email,
}, },
}, },
} }
const output = searchInputMapping(tableWithUserCol, params)
expect(output.query.equal!["1:user"]).toBe(email)
}) })
}) })

View File

@ -11,7 +11,7 @@ import { db as dbCore } from "@budibase/backend-core"
function findColumnInQueries( function findColumnInQueries(
column: string, column: string,
options: SearchParams, options: SearchParams,
callback: <T>(filter: T) => T callback: (filter: any) => any
) { ) {
for (let filterBlock of Object.values(options.query)) { for (let filterBlock of Object.values(options.query)) {
if (typeof filterBlock !== "object") { if (typeof filterBlock !== "object") {