Skip to content

Commit 10daf1d

Browse files
committed
Revert "Enable the "limit" param in /api/search"
This reverts commit 3d77685.
1 parent 23aa614 commit 10daf1d

File tree

3 files changed

+1
-9
lines changed

3 files changed

+1
-9
lines changed

pkg/services/search/handlers.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ func searchHandler(query *Query) error {
4444
IsStarred: query.IsStarred,
4545
OrgId: query.OrgId,
4646
DashboardIds: query.DashboardIds,
47-
Limit: query.Limit,
4847
}
4948

5049
if err := bus.Dispatch(&dashQuery); err != nil {

pkg/services/search/models.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ type FindPersistedDashboardsQuery struct {
4242
UserId int64
4343
IsStarred bool
4444
DashboardIds []int
45-
Limit int
4645

4746
Result HitList
4847
}

pkg/services/sqlstore/dashboard.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,6 @@ type DashboardSearchProjection struct {
123123
}
124124

125125
func SearchDashboards(query *search.FindPersistedDashboardsQuery) error {
126-
limit := query.Limit
127-
if limit == 0 {
128-
limit = 1000
129-
}
130-
131126
var sql bytes.Buffer
132127
params := make([]interface{}, 0)
133128

@@ -170,8 +165,7 @@ func SearchDashboards(query *search.FindPersistedDashboardsQuery) error {
170165
params = append(params, "%"+query.Title+"%")
171166
}
172167

173-
sql.WriteString(fmt.Sprintf(" ORDER BY dashboard.title ASC LIMIT ?"))
174-
params = append(params, limit)
168+
sql.WriteString(fmt.Sprintf(" ORDER BY dashboard.title ASC LIMIT 1000"))
175169

176170
var res []DashboardSearchProjection
177171

0 commit comments

Comments
 (0)