Измения в АПИ

This commit is contained in:
2025-08-07 18:33:28 +00:00
parent b2db578f5f
commit a1f1deea13
45 changed files with 1955 additions and 1119 deletions

View File

@@ -1,5 +1,5 @@
import { Metadata } from 'next';
import { tvAPI } from '@/lib/api';
import { tvShowsAPI } from '@/lib/neoApi';
import TVPage from '@/app/tv/[id]/TVPage';
export const dynamic = 'force-dynamic';
@@ -10,12 +10,11 @@ interface PageProps {
};
}
// Генерация метаданных для страницы
export async function generateMetadata(props: Promise<PageProps>): Promise<Metadata> {
const { params } = await props;
try {
const showId = params.id;
const { data: show } = await tvAPI.getShow(showId);
const { data: show } = await tvShowsAPI.getTVShow(showId);
return {
title: `${show.name} - NeoMovies`,
@@ -29,10 +28,9 @@ export async function generateMetadata(props: Promise<PageProps>): Promise<Metad
}
}
// Получение данных для страницы
async function getData(id: string) {
try {
const { data: show } = await tvAPI.getShow(id);
const { data: show } = await tvShowsAPI.getTVShow(id);
return { id, show };
} catch (error) {
throw new Error('Failed to fetch TV show');