So weird issue here. I'm trying to do serverside pagination.
Frontend:
let prevButton = <Link href={{pathname:"links", query:{after:props.prev}}}>Previous 25</Link>
let nextButton = <Link href={{pathname:"links", query:{after:props.next}}}>next 25</Link>
if (props.prev < 0){
prevButton = <></>
}
if (links.length < 25){
nextButton = <></>
}
nextAndPrevButtons = <>{prevButton}{nextButton}</>
}```
backend:
```ts
getServerSideProps({req, query}:any){
...
after = parseInt(query.after as string)
....
let linkData:LinkWithViews[] = await prisma.generatedLink.findMany({
skip:after,
take:25,
where:{
userID:user.id
},
...
So when I try this, what ends up happening is the URL changes, and "After" changes (as viewed by console.log) but the actual findmany collected by prisma appear to be the same. Then I refresh and everything works. So the issue basically is that it will appear to navigate to the new page/pagination index, gather the correct data, but the links are the same as before (you can click "next" a dozen times until after says 2000 or something and it will still be the same). So I'm seeing the page as if it had a previous pagination. But refreshing it will fix this problem.
Any idea what's going on here?