diff --git a/app/product/[id]/page.tsx b/app/product/[id]/page.tsx
index b732238..615b9da 100644
--- a/app/product/[id]/page.tsx
+++ b/app/product/[id]/page.tsx
@@ -42,14 +42,15 @@ export default async function Page({ params }: { params: { id: string } }) {
},
}));
- if (!is_reviewable || !user) return
Loading ....
- const prev_review = await db.review.findFirst({
+ if (is_reviewable === null) return Loading ...
+
+ const prev_review = (!user) ? null : ( await db.review.findFirst({
where : {
productId : id,
userId : user.id as string
}
- })
-
+ }))
+ console.log(prev_review)
const is_reviewables : Cascade_review[] = is_reviewable.reviews
const data = await db.product.findFirst({
where: {
@@ -176,7 +177,7 @@ export default async function Page({ params }: { params: { id: string } }) {
Review section
-
+ {(isAuthenticated()) ? ( ): (<>>)}