From 36b3416e37f3648e89f419499526b97c2fcc07bf Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Sun, 7 Aug 2022 17:27:31 +0200 Subject: [PATCH] get page to query param --- web/js/users.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/web/js/users.js b/web/js/users.js index 79d2ad7..eabcb01 100644 --- a/web/js/users.js +++ b/web/js/users.js @@ -42,7 +42,16 @@ instance.get("users/count", { withCredentials: true }).then(function(response){ }); -instance.get("users", {withCredentials: true, params :{ page:0, nbPages: nbPages}}).then(function(response){ + + +var page = 0; +var pageCurrent = getQuery("page"); +if (pageCurrent.length > 0){ + page = Number.parseInt(pageCurrent); + page = page - 1; +} + +instance.get("users", {withCredentials: true, params :{ page:page, nbPages: nbPages}}).then(function(response){ var trTag = document.querySelector("#users tbody tr").cloneNode(true); listData = response.data; for (var i=0; i