feat: paginate workshops and videos pages

This commit is contained in:
Xavier Oliveira
2026-05-27 09:30:13 +01:00
parent da0baaee15
commit 68f99798ce
72 changed files with 3352 additions and 1044 deletions
@@ -0,0 +1,23 @@
import type { ApiErrorResponse, Video } from "../types";
export function useNextVideos() {
async function getNextVideos() {
const response = await fetch("http://127.0.0.1:8000/api/next-videos", {
method: "GET",
headers: {
Accept: "application/json",
"Content-Type": "application/json",
Authorization: `Bearer ${localStorage.getItem("token")}`
},
});
const data = await response.json();
if (response.ok) {
return {
videos: data.data as Video[],
};
} else {
return data as ApiErrorResponse;
}
}
return { getNextVideos };
}