Minor bug fixes

This commit is contained in:
utkarshcmu
2016-01-19 05:05:24 -08:00
parent 41fd0ed467
commit ca55d1f315
5 changed files with 42 additions and 42 deletions
+15 -15
View File
@@ -101,23 +101,23 @@ func DeleteDashboardSnapshot(c *middleware.Context) {
}
func SearchDashboardSnapshots(c *middleware.Context) Response {
query := c.Query("query")
limit := c.QueryInt("limit")
query := c.Query("query")
limit := c.QueryInt("limit")
if limit == 0 {
limit = 1000
}
if limit == 0 {
limit = 1000
}
searchQuery := m.GetDashboardSnapshotsQuery{
Name: query,
Limit: limit,
OrgId: c.OrgId,
}
searchQuery := m.GetDashboardSnapshotsQuery{
Name: query,
Limit: limit,
OrgId: c.OrgId,
}
err := bus.Dispatch(&searchQuery)
if err != nil {
return ApiError(500, "Search failed", err)
}
err := bus.Dispatch(&searchQuery)
if err != nil {
return ApiError(500, "Search failed", err)
}
return Json(200, searchQuery.Result)
return Json(200, searchQuery.Result)
}