get page to query param

This commit is contained in:
Valentin CZERYBA 2022-08-07 17:27:31 +02:00
parent 19e7975b1f
commit 36b3416e37

View File

@ -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<listData.length; i++){