mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Fix compareValue check for _null and _empty type of operators (#13388)
This commit is contained in:
@@ -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, '!=', '');
|
||||
|
||||
@@ -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, '=', '');
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user