renames PartialMatch to MatchAny
This commit is contained in:
@@ -211,7 +211,7 @@ func (r *SqlAnnotationRepo) Find(query *annotations.ItemQuery) ([]*annotations.I
|
||||
)
|
||||
`, strings.Join(keyValueFilters, " OR "))
|
||||
|
||||
if query.PartialMatch {
|
||||
if query.MatchAny {
|
||||
sql.WriteString(fmt.Sprintf(" AND (%s) > 0 ", tagsSubQuery))
|
||||
} else {
|
||||
sql.WriteString(fmt.Sprintf(" AND (%s) = %d ", tagsSubQuery, len(tags)))
|
||||
|
||||
@@ -199,11 +199,11 @@ func TestAnnotations(t *testing.T) {
|
||||
|
||||
Convey("Should find two annotations using partial match", func() {
|
||||
items, err := repo.Find(&annotations.ItemQuery{
|
||||
OrgId: 1,
|
||||
From: 1,
|
||||
To: 25,
|
||||
PartialMatch: true,
|
||||
Tags: []string{"rollback", "deploy"},
|
||||
OrgId: 1,
|
||||
From: 1,
|
||||
To: 25,
|
||||
MatchAny: true,
|
||||
Tags: []string{"rollback", "deploy"},
|
||||
})
|
||||
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
Reference in New Issue
Block a user