Search: Improvements for starred dashboard search (#64758)

* improvements for starred dashboard search

* fix workflows for the case when no dashboards are starred

* PR feedback (don't query DB if starred dashboards and requested but no starred IDs are found) and linting

* return empty list not null in case of no starred dashboards

* return empty list not null in case of no starred dashboards pt 2

* return empty list not null in case of no starred dashboards pt 3
This commit is contained in:
Ieva
2023-03-16 09:20:07 +00:00
committed by GitHub
parent 8617ad688d
commit f966045129
9 changed files with 107 additions and 102 deletions

View File

@@ -68,16 +68,6 @@ func (f OrgFilter) Where() (string, []interface{}) {
return "dashboard.org_id=?", []interface{}{f.OrgId}
}
type StarredFilter struct {
UserId int64
}
func (f StarredFilter) Where() (string, []interface{}) {
return `(SELECT count(*)
FROM star
WHERE star.dashboard_id = dashboard.id AND star.user_id = ?) > 0`, []interface{}{f.UserId}
}
type TitleFilter struct {
Dialect migrator.Dialect
Title string