refactor: implement blog fetching and pagination in BlogsPage component
This commit is contained in:
+2
-8
@@ -1,16 +1,10 @@
|
||||
import BlogsPage from "@/components/blogs";
|
||||
import Layout from "@/components/layout/StLayout";
|
||||
import { fetchReq } from "@/lib/req";
|
||||
|
||||
export default async function Blogs() {
|
||||
const API_URL = process.env.NEXT_PUBLIC_API_URL;
|
||||
|
||||
const response = await fetchReq(`${API_URL}/api/v1/blogs`);
|
||||
const blogs = response.blogs;
|
||||
|
||||
export default function Blogs() {
|
||||
return (
|
||||
<Layout name="/blogs">
|
||||
<BlogsPage blogs={blogs} />
|
||||
<BlogsPage />
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user