mirror of
https://github.com/grafana/grafana.git
synced 2026-08-18 17:15:08 -05:00
Added isStarred to search result hit, very inefficient loading right now but can be cached later on
This commit is contained in:
@@ -61,7 +61,13 @@ func UnstarDashboard(cmd *m.UnstarDashboardCommand) error {
|
||||
}
|
||||
|
||||
func GetUserStars(query *m.GetUserStarsQuery) error {
|
||||
query.Result = make([]m.Star, 0)
|
||||
err := x.Where("user_id=?", query.UserId).Find(&query.Result)
|
||||
var stars = make([]m.Star, 0)
|
||||
err := x.Where("user_id=?", query.UserId).Find(&stars)
|
||||
|
||||
query.Result = make(map[int64]bool)
|
||||
for _, star := range stars {
|
||||
query.Result[star.DashboardId] = true
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user