Explorar o código

Fix lists pagination breaking on the UI.

Kailash Nadh %!s(int64=3) %!d(string=hai) anos
pai
achega
56629ccb1c
Modificáronse 2 ficheiros con 5 adicións e 1 borrados
  1. 4 0
      cmd/lists.go
  2. 1 1
      frontend/src/views/Lists.vue

+ 4 - 0
cmd/lists.go

@@ -79,6 +79,10 @@ func handleGetLists(c echo.Context) error {
 	out.Total = out.Results[0].Total
 	out.Total = out.Results[0].Total
 	out.Page = pg.Page
 	out.Page = pg.Page
 	out.PerPage = pg.PerPage
 	out.PerPage = pg.PerPage
+	if out.PerPage == 0 {
+		out.PerPage = out.Total
+	}
+
 	return c.JSON(http.StatusOK, okResp{out})
 	return c.JSON(http.StatusOK, okResp{out})
 }
 }
 
 

+ 1 - 1
frontend/src/views/Lists.vue

@@ -130,7 +130,7 @@ export default Vue.extend({
       isFormVisible: false,
       isFormVisible: false,
       queryParams: {
       queryParams: {
         page: 1,
         page: 1,
-        orderBy: 'created_at',
+        orderBy: 'id',
         order: 'asc',
         order: 'asc',
       },
       },
     };
     };