fix(reviews): reflect pending moderation status on customer submission
This commit is contained in:
parent
7c7311544d
commit
e433770a9a
2 changed files with 6 additions and 1 deletions
|
|
@ -71,6 +71,11 @@ export function ProductReviewsSection({
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleReviewSubmitted = (newReview: ProductReviewItem) => {
|
const handleReviewSubmitted = (newReview: ProductReviewItem) => {
|
||||||
|
// If review is pending admin approval, do not append to public storefront list
|
||||||
|
if (newReview.is_approved === false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setData((prev) => {
|
setData((prev) => {
|
||||||
const existingReviews = prev ? prev.reviews : [];
|
const existingReviews = prev ? prev.reviews : [];
|
||||||
const updatedReviews = [newReview, ...existingReviews];
|
const updatedReviews = [newReview, ...existingReviews];
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ export function ReviewSubmissionModal({
|
||||||
<CheckCircle2 size={48} className="mx-auto text-emerald-500 animate-bounce" />
|
<CheckCircle2 size={48} className="mx-auto text-emerald-500 animate-bounce" />
|
||||||
<h4 className="text-lg font-bold text-gray-900">Thank You!</h4>
|
<h4 className="text-lg font-bold text-gray-900">Thank You!</h4>
|
||||||
<p className="text-sm text-gray-600">
|
<p className="text-sm text-gray-600">
|
||||||
Your review has been successfully submitted and verified.
|
Your review has been submitted and is currently pending moderation. It will be published once approved by our team.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue