From 56629ccb1c5600ba31f9a5308fe67647ddb27eac Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Sat, 18 Sep 2021 19:14:58 +0530 Subject: [PATCH] Fix lists pagination breaking on the UI. --- cmd/lists.go | 4 ++++ frontend/src/views/Lists.vue | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/lists.go b/cmd/lists.go index d965b24e..49bfb36a 100644 --- a/cmd/lists.go +++ b/cmd/lists.go @@ -79,6 +79,10 @@ func handleGetLists(c echo.Context) error { out.Total = out.Results[0].Total out.Page = pg.Page out.PerPage = pg.PerPage + if out.PerPage == 0 { + out.PerPage = out.Total + } + return c.JSON(http.StatusOK, okResp{out}) } diff --git a/frontend/src/views/Lists.vue b/frontend/src/views/Lists.vue index d9145580..c08e980a 100644 --- a/frontend/src/views/Lists.vue +++ b/frontend/src/views/Lists.vue @@ -130,7 +130,7 @@ export default Vue.extend({ isFormVisible: false, queryParams: { page: 1, - orderBy: 'created_at', + orderBy: 'id', order: 'asc', }, };