Fix search scenario with low limit and empty query string

This commit is contained in:
Alexander Zobnin
2024-09-11 15:28:54 +02:00
parent dc6134f3f8
commit f2bd969a3d
+1 -1
View File
@@ -97,7 +97,7 @@ type findDashboardsFn func(ctx context.Context, query *dashboards.FindPersistedD
// getFindDashboardsFn makes a decision which search method should be used
func (dr *DashboardServiceImpl) getFindDashboardsFn(query *dashboards.FindPersistedDashboardsQuery) findDashboardsFn {
if query.Limit > 0 && query.Limit < maxListQueryLimit {
if query.Limit > 0 && query.Limit < maxListQueryLimit && len(query.Title) > 0 {
return dr.findDashboardsZanzanaCheck
}
if len(query.DashboardUIDs) > 0 && len(query.DashboardUIDs) < maxListQueryLimit {