Fix compareValue check for _null and _empty type of operators (#13388)

This commit is contained in:
ian
2022-05-19 01:38:38 +08:00
committed by GitHub
parent 01d043252e
commit ba3fcb8247
5 changed files with 7 additions and 4 deletions

View File

@@ -3,7 +3,7 @@ import { registerOperator } from './operator-register';
export default registerOperator({
operator: '_empty',
apply: ({ query, selectionRaw, compareValue }) => {
if (compareValue === true) {
if (compareValue) {
query.where(selectionRaw, '=', '');
} else {
query.where(selectionRaw, '!=', '');

View File

@@ -3,7 +3,7 @@ import { registerOperator } from './operator-register';
export default registerOperator({
operator: '_nempty',
apply: ({ query, selectionRaw, compareValue }) => {
if (compareValue === true) {
if (compareValue) {
query.where(selectionRaw, '!=', '');
} else {
query.where(selectionRaw, '=', '');

View File

@@ -3,7 +3,7 @@ import { registerOperator } from './operator-register';
export default registerOperator({
operator: '_nnull',
apply: ({ query, selectionRaw, compareValue }) => {
if (compareValue === true) {
if (compareValue) {
query.whereNotNull(selectionRaw);
} else {
query.whereNull(selectionRaw);

View File

@@ -3,7 +3,7 @@ import { registerOperator } from './operator-register';
export default registerOperator({
operator: '_null',
apply: ({ query, selectionRaw, compareValue }) => {
if (compareValue === true) {
if (compareValue) {
query.whereNull(selectionRaw);
} else {
query.whereNotNull(selectionRaw);