Skip to content

Commit

Permalink
Merge pull request #419 from openinfradev/filter_fix
Browse files Browse the repository at this point in the history
Filter fix
  • Loading branch information
cho4036 authored Apr 23, 2024
2 parents e06d8ec + 0757ba2 commit 9673e8c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions api/swagger/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -15249,6 +15249,9 @@ const docTemplate = `{
"messageTitle": {
"type": "string"
},
"name": {
"type": "string"
},
"node": {
"type": "string"
},
Expand Down
3 changes: 3 additions & 0 deletions api/swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -15243,6 +15243,9 @@
"messageTitle": {
"type": "string"
},
"name": {
"type": "string"
},
"node": {
"type": "string"
},
Expand Down
2 changes: 2 additions & 0 deletions api/swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3348,6 +3348,8 @@ definitions:
type: string
messageTitle:
type: string
name:
type: string
node:
type: string
notificationType:
Expand Down
8 changes: 4 additions & 4 deletions internal/filter/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var (
if dataType != DataTypeText && dataType != DataTypeEnum {
return filter.Where(tx, "FALSE")
}
query := castEnumAsText(column, dataType) + " LIKE ?"
query := castEnumAsText(column, dataType) + " ILIKE ?"
value := sqlutil.EscapeLike(filter.Args[0]) + "%"
return filter.Where(tx, query, value)
},
Expand All @@ -46,7 +46,7 @@ var (
if dataType != DataTypeText && dataType != DataTypeEnum {
return filter.Where(tx, "FALSE")
}
query := castEnumAsText(column, dataType) + " LIKE ?"
query := castEnumAsText(column, dataType) + " ILIKE ?"
value := "%" + sqlutil.EscapeLike(filter.Args[0])
return filter.Where(tx, query, value)
},
Expand All @@ -57,7 +57,7 @@ var (
if dataType != DataTypeText && dataType != DataTypeEnum {
return filter.Where(tx, "FALSE")
}
query := castEnumAsText(column, dataType) + " LIKE ?"
query := castEnumAsText(column, dataType) + " ILIKE ?"
value := "%" + sqlutil.EscapeLike(filter.Args[0]) + "%"
return filter.Where(tx, query, value)
},
Expand All @@ -68,7 +68,7 @@ var (
if dataType != DataTypeText && dataType != DataTypeEnum {
return filter.Where(tx, "FALSE")
}
query := castEnumAsText(column, dataType) + " NOT LIKE ?"
query := castEnumAsText(column, dataType) + " NOT ILIKE ?"
value := "%" + sqlutil.EscapeLike(filter.Args[0]) + "%"
return filter.Where(tx, query, value)
},
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/system-notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ type CreateSystemNotificationRequest struct {

type SystemNotificationResponse struct {
ID string `json:"id"`
Name string `json:"name"`
OrganizationId string `json:"organizationId"`
Severity string `json:"severity"`
MessageTitle string `json:"messageTitle"`
Expand Down

0 comments on commit 9673e8c

Please sign in to comment.