mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user