PublicDashboards: Audit table pagination (#69823)

This commit is contained in:
Juan Cabanas
2023-06-21 10:48:09 -03:00
committed by GitHub
parent ed5a697825
commit ee73d41d24
20 changed files with 475 additions and 305 deletions
+18 -1
View File
@@ -90,7 +90,24 @@ func (api *Api) RegisterAPIEndpoints() {
// ListPublicDashboards Gets list of public dashboards by orgId
// GET /api/dashboards/public-dashboards
func (api *Api) ListPublicDashboards(c *contextmodel.ReqContext) response.Response {
resp, err := api.PublicDashboardService.FindAll(c.Req.Context(), c.SignedInUser, c.OrgID)
perPage := c.QueryInt("perpage")
if perPage <= 0 {
perPage = 1000
}
page := c.QueryInt("page")
if page < 1 {
page = 1
}
resp, err := api.PublicDashboardService.FindAllWithPagination(c.Req.Context(), &PublicDashboardListQuery{
OrgID: c.OrgID,
Query: c.Query("query"),
Page: page,
Limit: perPage,
User: c.SignedInUser,
})
if err != nil {
return response.Err(err)
}