diff --git a/app/news/detail/[id]/page.tsx b/app/news/detail/[id]/page.tsx index c29b186..e21d5e9 100644 --- a/app/news/detail/[id]/page.tsx +++ b/app/news/detail/[id]/page.tsx @@ -7,19 +7,19 @@ type Props = { params: { id: string }; }; -export async function generateMetadata({ params }: any): Promise { - const res = await getArticleById(params.id?.split("-")[0]); - const article = res?.data?.data; - return { - title: article.title, - description: article.description, - openGraph: { - title: article.title, - description: article.description, - images: [`${article.thumbnailUrl}`], - }, - }; -} +// export async function generateMetadata({ params }: any): Promise { +// const res = await getArticleById(params.id?.split("-")[0]); +// const article = res?.data?.data; +// return { +// title: article.title, +// description: article.description, +// openGraph: { +// title: article.title, +// description: article.description, +// images: [`${article.thumbnailUrl}`], +// }, +// }; +// } export default async function NewsPage({ params }: any) { const articleId = params.id?.split("-")[0]; diff --git a/components/landing/NewsTicker.tsx b/components/landing/NewsTicker.tsx index d0b0af5..630396d 100644 --- a/components/landing/NewsTicker.tsx +++ b/components/landing/NewsTicker.tsx @@ -12,7 +12,13 @@ export default function NewsTicker() { useEffect(() => { async function getArticle() { - const req = { page: 1, search: "", limit: "10" }; + const req = { + page: 1, + search: "", + limit: "10", + sortBy: "created_at", + sort: "desc", + }; const response = await getListArticle(req); setArticle(response?.data?.data); } diff --git a/components/page/sidebar-detail.tsx b/components/page/sidebar-detail.tsx index 913e806..6a2530d 100644 --- a/components/page/sidebar-detail.tsx +++ b/components/page/sidebar-detail.tsx @@ -17,7 +17,7 @@ export default function SidebarDetail() { useEffect(() => { async function getArticle() { - const req = { page: 1, search: "", limit: "10" }; + const req = { page: 1, search: "", limit: "10", isPublish: true }; const response = await getListArticle(req); setArticle(response?.data?.data); diff --git a/next.config.js b/next.config.js index 298b318..8a86bff 100644 --- a/next.config.js +++ b/next.config.js @@ -52,14 +52,14 @@ const nextConfig = { eslint: { ignoreDuringBuilds: true, }, - experimental: { - serverActions: true, - pwa: { - dest: "public", - register: true, - skipWaiting: true, - }, - }, + // experimental: { + // serverActions: true, + // pwa: { + // dest: "public", + // register: true, + // skipWaiting: true, + // }, + // }, images: { remotePatterns: [ { diff --git a/services/article.ts b/services/article.ts index d2aa217..558e1cd 100644 --- a/services/article.ts +++ b/services/article.ts @@ -32,7 +32,7 @@ export async function getListArticle(props: PaginationRequest) { }&title=${search}&startDate=${startDate || ""}&endDate=${ endDate || "" }&categoryId=${category || ""}&sortBy=${sortBy || "created_at"}&sort=${ - sort || "asc" + sort || "desc" }&category=${categorySlug || ""}&isBanner=${isBanner || ""}`, headers );