Merge pull request #19 from olegvodyanov/add_pagination

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

View File

@ -3,9 +3,10 @@ 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');
const PER_PAGE = 8;
let currentPage = 1;
function loadLinks() { function loadLinks() {
const PER_PAGE = 8;
let currentPage = 1;
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 => {