From d48587bdfd94a698d59e4125ec00e33e8d6a0da5 Mon Sep 17 00:00:00 2001 From: musiur Date: Fri, 6 Dec 2024 15:41:45 +0600 Subject: [PATCH] fix build issue with review fetch --- src/app/_utils/masonry-layout.tsx | 7 +++---- src/app/reviews/page.tsx | 7 +++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/app/_utils/masonry-layout.tsx b/src/app/_utils/masonry-layout.tsx index 6442f4c..ee1fb9e 100644 --- a/src/app/_utils/masonry-layout.tsx +++ b/src/app/_utils/masonry-layout.tsx @@ -3,13 +3,12 @@ import { TestimonialCard } from "../services/_utils/testimonials"; import ANIM__FadeInOutOnScroll from "@/components/anims/fadein.anim"; import { Action___GET__AllReviews } from "../reviews/post/_utils/actions"; -const MasonryLayout = async () => { - const reviews = await Action___GET__AllReviews(); +const MasonryLayout = ({ reviews }: { reviews: object[] }) => { return (
- {reviews?.data?.length ? ( - reviews.data.map((review: any) => { + {reviews?.length ? ( + reviews.map((review: any) => { return ( diff --git a/src/app/reviews/page.tsx b/src/app/reviews/page.tsx index 5b45fa2..7624350 100644 --- a/src/app/reviews/page.tsx +++ b/src/app/reviews/page.tsx @@ -1,13 +1,16 @@ import MasonryLayout from "../_utils/masonry-layout"; +import { Action___GET__AllReviews } from "./post/_utils/actions"; -const Reviews = () => { +const Reviews = async () => { + const result = await Action___GET__AllReviews(); + const reviews = result?.data?.length ? result?.data : []; return (

Our Wall of Love

- +
);