mirror of
https://github.com/absmach/magistrala.git
synced 2026-06-23 04:10:28 +00:00
NOISSUE - Update tags filtering (#3376)
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
This commit is contained in:
@@ -781,7 +781,7 @@ components:
|
||||
|
||||
Tags:
|
||||
name: tags
|
||||
description: Channel tags. Multiple tags can be specified separated by comma for OR condition and hyphen for AND condition.
|
||||
description: Channel tags. Multiple tags can be specified separated by comma for OR condition and plus for AND condition.
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
|
||||
@@ -1282,7 +1282,7 @@ components:
|
||||
|
||||
Tags:
|
||||
name: tags
|
||||
description: Clients tags. Multiple tags can be specified separated by comma for OR condition and hyphen for AND condition.
|
||||
description: Clients tags. Multiple tags can be specified separated by comma for OR condition and plus for AND condition.
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
|
||||
@@ -1182,7 +1182,7 @@ components:
|
||||
additionalProperties: {}
|
||||
Tags:
|
||||
name: tags
|
||||
description: Domain tags. Multiple tags can be specified separated by comma for OR condition and hyphen for AND condition.
|
||||
description: Domain tags. Multiple tags can be specified separated by comma for OR condition and plus for AND condition.
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
|
||||
@@ -1388,7 +1388,7 @@ components:
|
||||
|
||||
Tags:
|
||||
name: tags
|
||||
description: Group tags. Multiple tags can be specified separated by comma for OR condition and hyphen for AND condition.
|
||||
description: Group tags. Multiple tags can be specified separated by comma for OR condition and plus for AND condition.
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
|
||||
@@ -1147,7 +1147,7 @@ components:
|
||||
|
||||
Tags:
|
||||
name: tags
|
||||
description: User tags. Multiple tags can be specified separated by comma for OR condition and hyphen for AND condition.
|
||||
description: User tags. Multiple tags can be specified separated by comma for OR condition and plus for AND condition.
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
|
||||
@@ -759,7 +759,7 @@ func TestListChannels(t *testing.T) {
|
||||
},
|
||||
Channels: []channels.Channel{validChannelResp},
|
||||
},
|
||||
query: "tags=tag1-tag2-tag3",
|
||||
query: "tags=tag1%2Btag2%2Btag3",
|
||||
status: http.StatusOK,
|
||||
err: nil,
|
||||
},
|
||||
|
||||
@@ -61,8 +61,8 @@ type TagsQuery struct {
|
||||
|
||||
func ToTagsQuery(s string) TagsQuery {
|
||||
switch {
|
||||
case strings.Contains(s, "-"):
|
||||
elements := strings.Split(s, "-")
|
||||
case strings.Contains(s, "+"):
|
||||
elements := strings.Split(s, "+")
|
||||
for i := range elements {
|
||||
elements[i] = strings.TrimSpace(elements[i])
|
||||
}
|
||||
|
||||
@@ -705,7 +705,7 @@ func TestListClients(t *testing.T) {
|
||||
},
|
||||
Clients: []clients.Client{client},
|
||||
},
|
||||
query: "tags=tag1-tag2-tag3",
|
||||
query: "tags=tag1%2Btag2%2Btag3",
|
||||
status: http.StatusOK,
|
||||
err: nil,
|
||||
},
|
||||
|
||||
+2
-2
@@ -210,8 +210,8 @@ type TagsQuery struct {
|
||||
|
||||
func ToTagsQuery(s string) TagsQuery {
|
||||
switch {
|
||||
case strings.Contains(s, "-"):
|
||||
elements := strings.Split(s, "-")
|
||||
case strings.Contains(s, "+"):
|
||||
elements := strings.Split(s, "+")
|
||||
for i := range elements {
|
||||
elements[i] = strings.TrimSpace(elements[i])
|
||||
}
|
||||
|
||||
@@ -468,7 +468,7 @@ func TestListDomains(t *testing.T) {
|
||||
Total: 1,
|
||||
Domains: []domains.Domain{domain},
|
||||
},
|
||||
query: "tags=tag1-tag2-tag3",
|
||||
query: "tags=tag1%2Btag2%2Btag3",
|
||||
status: http.StatusOK,
|
||||
err: nil,
|
||||
},
|
||||
|
||||
+2
-2
@@ -137,8 +137,8 @@ type TagsQuery struct {
|
||||
|
||||
func ToTagsQuery(s string) TagsQuery {
|
||||
switch {
|
||||
case strings.Contains(s, "-"):
|
||||
elements := strings.Split(s, "-")
|
||||
case strings.Contains(s, "+"):
|
||||
elements := strings.Split(s, "+")
|
||||
for i := range elements {
|
||||
elements[i] = strings.TrimSpace(elements[i])
|
||||
}
|
||||
|
||||
@@ -1071,7 +1071,7 @@ func TestListGroups(t *testing.T) {
|
||||
},
|
||||
Groups: []groups.Group{validGroupResp},
|
||||
},
|
||||
query: "tags=tag1-tag2-tag3",
|
||||
query: "tags=tag1%2Btag2%2Btag3",
|
||||
status: http.StatusOK,
|
||||
err: nil,
|
||||
},
|
||||
|
||||
+2
-2
@@ -19,8 +19,8 @@ type TagsQuery struct {
|
||||
|
||||
func ToTagsQuery(s string) TagsQuery {
|
||||
switch {
|
||||
case strings.Contains(s, "-"):
|
||||
elements := strings.Split(s, "-")
|
||||
case strings.Contains(s, "+"):
|
||||
elements := strings.Split(s, "+")
|
||||
for i := range elements {
|
||||
elements[i] = strings.TrimSpace(elements[i])
|
||||
}
|
||||
|
||||
+2
-2
@@ -103,8 +103,8 @@ type TagsQuery struct {
|
||||
|
||||
func ToTagsQuery(s string) TagsQuery {
|
||||
switch {
|
||||
case strings.Contains(s, "-"):
|
||||
elements := strings.Split(s, "-")
|
||||
case strings.Contains(s, "+"):
|
||||
elements := strings.Split(s, "+")
|
||||
for i := range elements {
|
||||
elements[i] = strings.TrimSpace(elements[i])
|
||||
}
|
||||
|
||||
@@ -721,7 +721,7 @@ func TestListUsers(t *testing.T) {
|
||||
},
|
||||
Users: []users.User{user},
|
||||
},
|
||||
query: "tags=tag1-tag2-tag3",
|
||||
query: "tags=tag1%2Btag2%2Btag3",
|
||||
status: http.StatusOK,
|
||||
authnRes: verifiedSession,
|
||||
err: nil,
|
||||
|
||||
+2
-2
@@ -157,8 +157,8 @@ type TagsQuery struct {
|
||||
|
||||
func ToTagsQuery(s string) TagsQuery {
|
||||
switch {
|
||||
case strings.Contains(s, "-"):
|
||||
elements := strings.Split(s, "-")
|
||||
case strings.Contains(s, "+"):
|
||||
elements := strings.Split(s, "+")
|
||||
for i := range elements {
|
||||
elements[i] = strings.TrimSpace(elements[i])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user