feat: Implement blog API service and refactor components for improved data fetching

This commit is contained in:
Wini_Fy
2026-02-04 15:33:02 +07:00
parent d46c420aaf
commit 9a71d39ebf
16 changed files with 790 additions and 149 deletions

View File

@@ -1,6 +1,6 @@
import Breadcrumb from "@/app/components/Breadcrumb";
import NewsSection from "./components/NewsSection";
import { fetchBlogList } from "@/api/blog";
import { fetchBlogList } from "@/api/blogsApi";
interface NewsPageProps {
searchParams?: Promise<{ search?: string; page?: string }> | { search?: string; page?: string };
@@ -16,7 +16,7 @@ export default async function NewsPage({ searchParams }: NewsPageProps) {
// Fetch blog list from API
const blogResponse = await fetchBlogList({
page: currentPage,
limit: 10,
limit: 3,
...(searchQuery ? { search: searchQuery } : {}),
});
const { blogs, pagination } = blogResponse.data;