Browse Source

add replace of * to % in fetch.

pull/1/head
Gisle Aune 3 years ago
parent
commit
3c2aa7212d
  1. 1
      internal/mysql/devicerepo.go

1
internal/mysql/devicerepo.go

@ -68,6 +68,7 @@ func (r *DeviceRepo) FetchByReference(ctx context.Context, kind models.Reference
case models.RKBridgeID:
q = q.Where(sq.Eq{"bridge_id": strings.Split(value, ",")})
case models.RKName:
value = strings.ReplaceAll(value, "*", "%")
q = q.Where(sq.Like{"name": value})
case models.RKTag:
allTags := strings.Split(strings.ReplaceAll(strings.ReplaceAll(value, "-", ",-"), "+", ",+"), ",")

Loading…
Cancel
Save