mirror of
https://github.com/nocobase/nocobase
synced 2024-11-14 16:34:14 +00:00
fix(client): string operators "contains/does not contains" should handle null
value (#5509)
Some checks are pending
Build docker image / build-and-push (push) Waiting to run
Build pro image / build-and-push (push) Waiting to run
Deploy client docs / Build (push) Waiting to run
E2E / Build (push) Waiting to run
E2E / Core and plugins (push) Blocked by required conditions
E2E / plugin-workflow (push) Blocked by required conditions
E2E / plugin-workflow-approval (push) Blocked by required conditions
E2E / plugin-data-source-main (push) Blocked by required conditions
E2E / Comment on PR (push) Blocked by required conditions
NocoBase backend test / sqlite-test (20, false) (push) Waiting to run
NocoBase backend test / sqlite-test (20, true) (push) Waiting to run
NocoBase backend test / postgres-test (public, 20, nocobase, false) (push) Waiting to run
NocoBase backend test / postgres-test (public, 20, nocobase, true) (push) Waiting to run
NocoBase backend test / postgres-test (public, 20, public, false) (push) Waiting to run
NocoBase backend test / postgres-test (public, 20, public, true) (push) Waiting to run
NocoBase backend test / postgres-test (user_schema, 20, nocobase, false) (push) Waiting to run
NocoBase backend test / postgres-test (user_schema, 20, nocobase, true) (push) Waiting to run
NocoBase backend test / postgres-test (user_schema, 20, public, false) (push) Waiting to run
NocoBase backend test / postgres-test (user_schema, 20, public, true) (push) Waiting to run
NocoBase backend test / mysql-test (20, false) (push) Waiting to run
NocoBase backend test / mysql-test (20, true) (push) Waiting to run
NocoBase backend test / mariadb-test (20, false) (push) Waiting to run
NocoBase backend test / mariadb-test (20, true) (push) Waiting to run
NocoBase frontEnd test / frontend-test (18) (push) Waiting to run
Test on Windows / build (push) Waiting to run
Some checks are pending
Build docker image / build-and-push (push) Waiting to run
Build pro image / build-and-push (push) Waiting to run
Deploy client docs / Build (push) Waiting to run
E2E / Build (push) Waiting to run
E2E / Core and plugins (push) Blocked by required conditions
E2E / plugin-workflow (push) Blocked by required conditions
E2E / plugin-workflow-approval (push) Blocked by required conditions
E2E / plugin-data-source-main (push) Blocked by required conditions
E2E / Comment on PR (push) Blocked by required conditions
NocoBase backend test / sqlite-test (20, false) (push) Waiting to run
NocoBase backend test / sqlite-test (20, true) (push) Waiting to run
NocoBase backend test / postgres-test (public, 20, nocobase, false) (push) Waiting to run
NocoBase backend test / postgres-test (public, 20, nocobase, true) (push) Waiting to run
NocoBase backend test / postgres-test (public, 20, public, false) (push) Waiting to run
NocoBase backend test / postgres-test (public, 20, public, true) (push) Waiting to run
NocoBase backend test / postgres-test (user_schema, 20, nocobase, false) (push) Waiting to run
NocoBase backend test / postgres-test (user_schema, 20, nocobase, true) (push) Waiting to run
NocoBase backend test / postgres-test (user_schema, 20, public, false) (push) Waiting to run
NocoBase backend test / postgres-test (user_schema, 20, public, true) (push) Waiting to run
NocoBase backend test / mysql-test (20, false) (push) Waiting to run
NocoBase backend test / mysql-test (20, true) (push) Waiting to run
NocoBase backend test / mariadb-test (20, false) (push) Waiting to run
NocoBase backend test / mariadb-test (20, true) (push) Waiting to run
NocoBase frontEnd test / frontend-test (18) (push) Waiting to run
Test on Windows / build (push) Waiting to run
This commit is contained in:
parent
95aeb343f2
commit
18d31564b3
@ -12,6 +12,7 @@ const TYPE_TO_ACTION = {
|
||||
belongsTo: 'get',
|
||||
hasOne: 'get',
|
||||
belongsToMany: 'list?pageSize=9999',
|
||||
belongsToArray: 'get',
|
||||
};
|
||||
export const getAction = (type: string) => {
|
||||
if (process.env.NODE_ENV !== 'production' && !(type in TYPE_TO_ACTION)) {
|
||||
|
@ -16,6 +16,11 @@ function escapeLike(value: string) {
|
||||
|
||||
export default {
|
||||
$includes(value, ctx) {
|
||||
if (value === null) {
|
||||
return {
|
||||
[Op.is]: null,
|
||||
};
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
const conditions = value.map((item) => ({
|
||||
[isPg(ctx) ? Op.iLike : Op.like]: `%${escapeLike(item)}%`,
|
||||
@ -32,6 +37,11 @@ export default {
|
||||
},
|
||||
|
||||
$notIncludes(value, ctx) {
|
||||
if (value === null) {
|
||||
return {
|
||||
[Op.not]: null,
|
||||
};
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
const conditions = value.map((item) => ({
|
||||
[isPg(ctx) ? Op.notILike : Op.notLike]: `%${escapeLike(item)}%`,
|
||||
|
Loading…
Reference in New Issue
Block a user