mirror of
https://github.com/Radiquum/AniX.git
synced 2025-04-29 01:19:41 +05:00
feat: add franchise page
This commit is contained in:
parent
804ce02a07
commit
fda308eced
5 changed files with 124 additions and 20 deletions
19
app/related/[id]/page.tsx
Normal file
19
app/related/[id]/page.tsx
Normal file
|
@ -0,0 +1,19 @@
|
|||
import { RelatedPage } from "#/pages/Related";
|
||||
import { fetchDataViaGet } from "#/api/utils";
|
||||
|
||||
export async function generateMetadata({ params }) {
|
||||
const id:string = params.id;
|
||||
const related: any = await fetchDataViaGet(`https://api.anixart.tv/related/${id}/0`);
|
||||
const firstRelease: any = await fetchDataViaGet(`https://api.anixart.tv/release/${related.content[0].id}`);
|
||||
|
||||
return {
|
||||
title: "Франшиза " + firstRelease.release.related.name_ru || firstRelease.release.related.name,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function Related({ params }) {
|
||||
const id: string = params.id;
|
||||
const related: any = await fetchDataViaGet(`https://api.anixart.tv/related/${id}/0`);
|
||||
const firstRelease: any = await fetchDataViaGet(`https://api.anixart.tv/release/${related.content[0].id}`);
|
||||
return <RelatedPage id={id} title={firstRelease.release.related.name_ru || firstRelease.release.related.name} />;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue