Need a guidance on pagination

I'm trying to use pagination but need a guidance on how to achieve pagination through rest endpoint? I have 28 records. How to do it dynamically?
const res = await api.get(`/m_attribute?form_id=eq.${id}&select=*&order=attr_id`, {
headers: {
"Authorization": `Bearer ${accessToken}`,
"apikey": import.meta.env.VITE_SUPABASE_KEY,
"Range":"0-5"
}
})
return res.data
const res = await api.get(`/m_attribute?form_id=eq.${id}&select=*&order=attr_id`, {
headers: {
"Authorization": `Bearer ${accessToken}`,
"apikey": import.meta.env.VITE_SUPABASE_KEY,
"Range":"0-5"
}
})
return res.data
3 Replies
Aμαν
AμανOP2y ago
In the above example, I used fixed range
Socal
Socal2y ago
here's an example in nextjs on how to accomplish it https://www.youtube.com/watch?v=1LApZM0jELk
Daily Web Coding
YouTube
How to do pagination with supabase and next.js
In this video I am going to show you how to do pagination with supabase and next.js Support the channel : 🙏🌸 - buy our merch 👕 : https://daily-store-9.creator-spring.com/ - donate 🌻: https://www.patreon.com/dailywebcoding Follow me:   👇 - Discord: https://discord.gg/XbJkCtt - Github: https://github.com/Chensokheng

Did you find this page helpful?