light modification
This commit is contained in:
parent
66196da877
commit
c63a1fef6c
@ -80,6 +80,9 @@ func (a *peerMongoAccessor) getDefaultFilter(search string) *dbs.Filters {
|
||||
},
|
||||
}
|
||||
} else {
|
||||
if search == "*" {
|
||||
search = ""
|
||||
}
|
||||
return &dbs.Filters{
|
||||
Or: map[string][]dbs.Filter{ // search by name if no filters are provided
|
||||
"abstractobject.name": {{Operator: dbs.LIKE.String(), Value: search}},
|
||||
|
@ -90,6 +90,9 @@ func (wfa *resourceMongoAccessor[T]) Search(filters *dbs.Filters, search string,
|
||||
}
|
||||
|
||||
func (abs *resourceMongoAccessor[T]) getResourceFilter(search string) *dbs.Filters {
|
||||
if search == "*" {
|
||||
search = ""
|
||||
}
|
||||
return &dbs.Filters{
|
||||
Or: map[string][]dbs.Filter{ // filter by like name, short_description, description, owner, url if no filters are provided
|
||||
"abstractintanciatedresource.abstractresource.abstractobject.name": {{Operator: dbs.LIKE.String(), Value: search}},
|
||||
|
@ -53,6 +53,7 @@ func (a *ResourceModelMongoAccessor) LoadAll(isDraft bool) ([]utils.ShallowDBObj
|
||||
}
|
||||
|
||||
func (a *ResourceModelMongoAccessor) Search(filters *dbs.Filters, search string, isDraft bool) ([]utils.ShallowDBObject, int, error) {
|
||||
|
||||
return utils.GenericSearch[*ResourceModel](filters, search,
|
||||
&dbs.Filters{
|
||||
Or: map[string][]dbs.Filter{
|
||||
|
@ -88,6 +88,9 @@ func (ao *AbstractObject) VerifyAuth(request *tools.APIRequest) bool {
|
||||
}
|
||||
|
||||
func (ao *AbstractObject) GetObjectFilters(search string) *dbs.Filters {
|
||||
if search == "*" {
|
||||
search = ""
|
||||
}
|
||||
return &dbs.Filters{
|
||||
Or: map[string][]dbs.Filter{ // filter by name if no filters are provided
|
||||
"abstractobject.name": {{Operator: dbs.LIKE.String(), Value: search}},
|
||||
|
Loading…
Reference in New Issue
Block a user