From 188037f35adbdca54207126f7216f59d319cbc2c Mon Sep 17 00:00:00 2001 From: Jacob Hemming <j.hemming@students.uu.nl> Date: Mon, 26 Apr 2021 12:50:34 +0200 Subject: [PATCH] Back end matchType contrains fixed --- internal/usecases/convertquery/createConstraints.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/internal/usecases/convertquery/createConstraints.go b/internal/usecases/convertquery/createConstraints.go index b03d06f..7441762 100644 --- a/internal/usecases/convertquery/createConstraints.go +++ b/internal/usecases/convertquery/createConstraints.go @@ -48,20 +48,21 @@ func createConstraintBoolExpression(constraint *entity.QueryConstraintStruct, na case "text": value = fmt.Sprintf("\"%s\"", constraint.Value) switch constraint.MatchType { + case "NEQ": + match = "!=" case "contains": - match = "IN" - case "startswith": match = "LIKE" + case "excludes": + match = "NOT LIKE" value = fmt.Sprintf("\"%s%%\"", constraint.Value) - case "endswith": - match = "LIKE" - value = fmt.Sprintf("\"_%s\"", constraint.Value) - default: //exact + default: //EQ match = "==" } case "number": value = constraint.Value switch constraint.MatchType { + case "NEQ": + match = "!=" case "GT": match = ">" case "LT": -- GitLab