fixed sort in profile-reports table and in statistics table, improved error messages, improved metatags by fetching metadata from server

This commit is contained in:
Alibek committed 2024-03-16 02:19:33 +06:00
1 parent 0221a79015
commit 0ba0f1df89
25 files changed
+413 -171

No files matched your search

-1
View File
@@ -26,7 +26,6 @@ export async function generateMetadata({
type: "article",
publishedTime: response.data.created_at,
},
keywords: ["Новости КР", "Кыргызстан"],
};
}
+33 -4
View File
@@ -3,11 +3,40 @@ import "./News.scss";
import Typography from "@/shared/ui/components/Typography/Typography";
import NewsList from "@/widgets/NewsList/NewsList";
import { Metadata } from "next";
import { apiInstance } from "@/shared/config/apiConfig";
import { IMetatag } from "@/shared/types/metatag-type";
export const metadata: Metadata = {
title: "KG ROAD | Новости",
description: "Страница новостей KG ROAD",
};
export async function generateMetadata(): Promise<Metadata> {
const data = await apiInstance
.get<IMetatag[]>("/metatags/")
.then((res) => res.data)
.catch((e) => console.log(e));
if (!data)
return {
title: "KG ROAD | Новости",
description: "Страница новостей KG ROAD",
};
const metadata = data.filter((tag) => tag.page === "news")[0];
if (!metadata) {
return {
title: "KG ROAD | Новости",
description: "Страница новостей KG ROAD",
};
}
return {
title: `KG ROAD | ${metadata.title}`,
description: metadata.description,
keywords: metadata.keywords.split(","),
openGraph: {
title: `KG ROAD | ${metadata.title}`,
description: metadata.description,
type: "website",
},
};
}
const News = ({
searchParams,