Fix notContains tests again.
This commit is contained in:
parent
4a42439647
commit
e14918c105
|
@ -740,12 +740,12 @@ class InternalBuilder {
|
||||||
return q
|
return q
|
||||||
}
|
}
|
||||||
|
|
||||||
return q.where(subQuery => {
|
q = q.where(subQuery => {
|
||||||
if (mode === filters?.notContains) {
|
if (mode === filters?.notContains) {
|
||||||
subQuery = subQuery.not
|
subQuery = subQuery.not
|
||||||
}
|
}
|
||||||
|
|
||||||
return subQuery.where(subSubQuery => {
|
subQuery = subQuery.where(subSubQuery => {
|
||||||
for (const elem of value) {
|
for (const elem of value) {
|
||||||
if (mode === filters?.containsAny) {
|
if (mode === filters?.containsAny) {
|
||||||
subSubQuery = subSubQuery.or
|
subSubQuery = subSubQuery.or
|
||||||
|
@ -765,7 +765,15 @@ class InternalBuilder {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
if (mode === filters?.notContains) {
|
||||||
|
subQuery = subQuery.or.whereNull(
|
||||||
|
// @ts-expect-error knex types are wrong, raw is fine here
|
||||||
|
this.rawQuotedIdentifier(key)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return subQuery
|
||||||
})
|
})
|
||||||
|
return q
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2163,7 +2163,7 @@ describe.each([
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe.only("multi user", () => {
|
describe("multi user", () => {
|
||||||
let user1: User
|
let user1: User
|
||||||
let user2: User
|
let user2: User
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue