Skip to content

Commit d48587b

Browse files
committed
fix build issue with review fetch
1 parent fb75058 commit d48587b

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/app/_utils/masonry-layout.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ import { TestimonialCard } from "../services/_utils/testimonials";
33
import ANIM__FadeInOutOnScroll from "@/components/anims/fadein.anim";
44
import { Action___GET__AllReviews } from "../reviews/post/_utils/actions";
55

6-
const MasonryLayout = async () => {
7-
const reviews = await Action___GET__AllReviews();
6+
const MasonryLayout = ({ reviews }: { reviews: object[] }) => {
87
return (
98
<div className="container mx-auto p-4">
109
<div className="columns-1 min-[700px]:columns-2 min-[1030px]:columns-3 space-x-4">
11-
{reviews?.data?.length ? (
12-
reviews.data.map((review: any) => {
10+
{reviews?.length ? (
11+
reviews.map((review: any) => {
1312
return (
1413
<ANIM__FadeInOutOnScroll key={review?._id} className="py-4">
1514
<TestimonialCard details={review} />

src/app/reviews/page.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import MasonryLayout from "../_utils/masonry-layout";
2+
import { Action___GET__AllReviews } from "./post/_utils/actions";
23

3-
const Reviews = () => {
4+
const Reviews = async () => {
5+
const result = await Action___GET__AllReviews();
6+
const reviews = result?.data?.length ? result?.data : [];
47
return (
58
<div className="bg-[url('/images/backgrounds/SquareBackground.svg')] bg-center bg-cover">
69
<div className="bg-gradient-to-r from-secondary/50 via-secondary to-secondary/50 section">
710
<h2 className="text-muted text-center">Our Wall of Love</h2>
811
</div>
912
<div className="-mt-[50px] container pb-20">
10-
<MasonryLayout />
13+
<MasonryLayout reviews={reviews} />
1114
</div>
1215
</div>
1316
);

0 commit comments

Comments
 (0)