feat(frontend): VideoPage react-player v3, fix data.videos, route /video/:id
This commit is contained in:
@@ -13,7 +13,7 @@ interface Video {
|
||||
|
||||
interface VideosResponse {
|
||||
success: boolean;
|
||||
data: Video[];
|
||||
data: { videos: Video[] };
|
||||
}
|
||||
|
||||
export default function HomePage() {
|
||||
@@ -22,7 +22,7 @@ export default function HomePage() {
|
||||
|
||||
useEffect(() => {
|
||||
apiFetch<VideosResponse>('/videos')
|
||||
.then((res) => setVideos(res.data))
|
||||
.then((res) => setVideos(res.data.videos))
|
||||
.catch(() => setVideos([]))
|
||||
.finally(() => setLoading(false));
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user