mirror of
https://github.com/Radiquum/AniX.git
synced 2025-05-01 10:29:40 +05:00
feat: add error messages to user pages
This commit is contained in:
parent
f2f03df1a0
commit
d16e4d14d4
10 changed files with 285 additions and 136 deletions
|
@ -16,19 +16,26 @@ export async function generateMetadata(
|
|||
parent: ResolvingMetadata
|
||||
): Promise<Metadata> {
|
||||
const id: string = params.id;
|
||||
const profile: any = await fetchDataViaGet(
|
||||
const { data, error } = await fetchDataViaGet(
|
||||
`https://api.anixart.tv/profile/${id}`
|
||||
);
|
||||
const previousOG = (await parent).openGraph;
|
||||
|
||||
if (error) {
|
||||
return {
|
||||
title: "Ошибка",
|
||||
description: "Ошибка",
|
||||
};
|
||||
};
|
||||
|
||||
return {
|
||||
title: SectionTitleMapping[params.slug] + " - " + profile.profile.login,
|
||||
description: profile.profile.status,
|
||||
title:"Закладки Пользователя - " + data.profile.login + " - " + SectionTitleMapping[params.slug],
|
||||
description: "Закладки Пользователя - " + data.profile.login + " - " + SectionTitleMapping[params.slug],
|
||||
openGraph: {
|
||||
...previousOG,
|
||||
images: [
|
||||
{
|
||||
url: profile.profile.avatar, // Must be an absolute URL
|
||||
url: data.profile.avatar, // Must be an absolute URL
|
||||
width: 600,
|
||||
height: 600,
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue