Adding negative test case and fixing build issue.
This commit is contained in:
parent
3de8c53166
commit
dc50515bcc
|
@ -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)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -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") {
|
||||||
|
|
Loading…
Reference in New Issue