mirror of
https://github.com/Radiquum/AniX.git
synced 2025-05-03 11:29:40 +05:00
front & back: getting ready for user auth
This commit is contained in:
parent
732799703d
commit
17b5693f34
4 changed files with 91 additions and 14 deletions
|
@ -30,11 +30,11 @@ export default function Home() {
|
|||
useEffect(() => {
|
||||
setList(searchParams.get("list") || "last");
|
||||
}, []);
|
||||
|
||||
|
||||
async function fetchData(list, page = 0) {
|
||||
const url = `${endpoints.index[list]}?page=${page}`;
|
||||
const data = await getData(url);
|
||||
|
||||
|
||||
// Handle initial load (page 0) or subsequent pagination
|
||||
if (page === 0) {
|
||||
setReleases(data.content);
|
||||
|
@ -49,7 +49,7 @@ export default function Home() {
|
|||
setPage(0);
|
||||
fetchData(list); // Call fetchData here
|
||||
}, [list]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (list && releases) {
|
||||
fetchData(list, page); // Use fetchData for pagination
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue