Merge pull request #18 from olegvodyanov/add_pagination
All checks were successful
continuous-integration/drone/push Build is passing

fix
This commit is contained in:
Олег Водянов 2025-04-23 10:48:28 +04:00 committed by GitHub
commit b3b4f72193
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,10 +3,9 @@ const addLinkBtn = document.getElementById('addLinkBtn');
const newLinksContainer = document.getElementById('newLinksContainer'); const newLinksContainer = document.getElementById('newLinksContainer');
const watchedLinksContainer = document.getElementById('watchedLinksContainer'); const watchedLinksContainer = document.getElementById('watchedLinksContainer');
function loadLinks() {
const PER_PAGE = 8; const PER_PAGE = 8;
let currentPage = 1; let currentPage = 1;
function loadLinks() {
fetch(`/api/links/?page=${currentPage}&per_page=${PER_PAGE}`) fetch(`/api/links/?page=${currentPage}&per_page=${PER_PAGE}`)
.then(res => res.json()) .then(res => res.json())
.then(data => { .then(data => {