mirror of
https://gitlab.com/foxixus/neomovies.git
synced 2025-10-29 02:18:49 +05:00
Измения в АПИ
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user