diff --git a/.env.development b/.env.development index 3dd3085..24d62d5 100644 --- a/.env.development +++ b/.env.development @@ -1,2 +1,3 @@ NEXT_PUBLIC_API_URL=http://localhost:8000/api +NEXT_PUBLIC_BLOG_API_URL=http://localhost:8000/api/blog NEXT_PUBLIC_FRONT_URL=http://localhost:3000 \ No newline at end of file diff --git a/.env.production b/.env.production index 68723d7..33ccdfc 100644 --- a/.env.production +++ b/.env.production @@ -1,2 +1,3 @@ NEXT_PUBLIC_API_URL=https://parsaaghayi-backend.liara.run/api +NEXT_PUBLIC_BLOG_API_URL=https://parsaaghayi-backend.liara.run/api/blog NEXT_PUBLIC_FRONT_URL=https://paqi.liara.run \ No newline at end of file diff --git a/src/app/(routes)/blog/categories/[categorySlug]/page.tsx b/src/app/(routes)/blog/categories/[categorySlug]/page.tsx index daf0449..686e6ec 100644 --- a/src/app/(routes)/blog/categories/[categorySlug]/page.tsx +++ b/src/app/(routes)/blog/categories/[categorySlug]/page.tsx @@ -10,7 +10,7 @@ export default async function SingleCategory({ searchParams, }: categorySlugPropsType) { const categoryData: CategoryDataType = await fetch( - `${process.env.NEXT_PUBLIC_API_URL}/blog/categories/${params.categorySlug}/posts?per_page=${searchParams.per_page ? searchParams.per_page : process.env.NEXT_PUBLIC_POSTS_PER_CATEGORY_PAGE}${searchParams.page ? `&page=${searchParams.page}` : ""}`, + `${process.env.NEXT_PUBLIC_BLOG_API_URL}/categories/${params.categorySlug}/posts?per_page=${searchParams.per_page ? searchParams.per_page : process.env.NEXT_PUBLIC_POSTS_PER_CATEGORY_PAGE}${searchParams.page ? `&page=${searchParams.page}` : ""}`, { cache: "no-store", }, @@ -65,7 +65,7 @@ export default async function SingleCategory({ -