forked from UKSOURCE/hailearning.edu.vn
feat: Implement blog API service and refactor components for improved data fetching
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user