Add []namespaceID to ComposeNamespace filter
This commit is contained in:
@@ -28,9 +28,10 @@ type (
|
||||
}
|
||||
|
||||
NamespaceFilter struct {
|
||||
Query string `json:"query"`
|
||||
Slug string `json:"slug"`
|
||||
Name string `json:"name"`
|
||||
NamespaceID []uint64 `json:"namespaceID"`
|
||||
Query string `json:"query"`
|
||||
Slug string `json:"slug"`
|
||||
Name string `json:"name"`
|
||||
|
||||
LabeledIDs []uint64 `json:"-"`
|
||||
Labels map[string]string `json:"labels,omitempty"`
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package rdbms
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/Masterminds/squirrel"
|
||||
"github.com/cortezaproject/corteza-server/compose/types"
|
||||
"github.com/cortezaproject/corteza-server/pkg/filter"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func (s Store) convertComposeNamespaceFilter(f types.NamespaceFilter) (query squirrel.SelectBuilder, err error) {
|
||||
@@ -12,6 +13,10 @@ func (s Store) convertComposeNamespaceFilter(f types.NamespaceFilter) (query squ
|
||||
|
||||
query = filter.StateCondition(query, "cns.deleted_at", f.Deleted)
|
||||
|
||||
if len(f.NamespaceID) > 0 {
|
||||
query = query.Where(squirrel.Eq{"cns.id": f.NamespaceID})
|
||||
}
|
||||
|
||||
if len(f.LabeledIDs) > 0 {
|
||||
query = query.Where(squirrel.Eq{"cns.id": f.LabeledIDs})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user