prevent user going over max pages by narrowing search while page > 1
This commit is contained in:
parent
39313a5564
commit
57095b2371
1 changed files with 10 additions and 0 deletions
|
@ -111,6 +111,11 @@ elements.searchUsersForm.addEventListener('submit', async e => {
|
|||
alert("Failed to list users: " + data.error);
|
||||
return false;
|
||||
}
|
||||
if (page > data.totalPageCount!) {
|
||||
elements.usersPage.value = data.totalPageCount!.toString(10);
|
||||
elements.searchUsersForm.requestSubmit();
|
||||
return false;
|
||||
}
|
||||
elements.usersTableBody.innerHTML = "";
|
||||
elements.usersPageCount.innerText = data.totalPageCount!.toString(10);
|
||||
elements.usersPage.max = data.totalPageCount!.toString(10);
|
||||
|
@ -196,6 +201,11 @@ elements.searchBotsForm.addEventListener('submit', async e => {
|
|||
alert("Failed to list bots: " + data.error);
|
||||
return false;
|
||||
}
|
||||
if (page > data.totalPageCount!) {
|
||||
elements.botsPage.value = data.totalPageCount!.toString(10);
|
||||
elements.searchBotsForm.requestSubmit();
|
||||
return false;
|
||||
}
|
||||
elements.botsTableBody.innerHTML = "";
|
||||
elements.botsPageCount.innerText = data.totalPageCount!.toString(10);
|
||||
elements.botsPage.max = data.totalPageCount!.toString(10);
|
||||
|
|
Loading…
Reference in a new issue