Skip to content

Commit

Permalink
process testimonials not reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
maltenuhn committed May 2, 2024
1 parent c4a820c commit 6b80d19
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions app/routes/trippy-trails-template.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { useLoaderData } from '@remix-run/react'
import { defer, json } from '@shopify/remix-oxygen'
import { Column, PageTitle } from '../components/Components'

export function processReviews(reviews) {
return reviews.nodes.map((review) => ({
id: review.id,
rating: JSON.parse(review.rating.value).value,
summary: review.summary.value,
reviewerName: review.reviewerName.value,
countryEmoji: review.countryEmoji.value,
title: review.title.value,
export function processTestimonials(testimonial) {
return reviews.nodes.map((testimonial) => ({
id: testimonial.id,
rating: JSON.parse(testimonial.rating.value).value,
summary: testimonial.summary.value,
reviewerName: testimonial.reviewerName.value,
countryEmoji: testimonial.countryEmoji.value,
title: testimonial.title.value,
}))
}

Expand All @@ -26,7 +26,7 @@ export async function loader({ params, context }) {
)

return defer({
reviews: processReviews(reviews),
reviews: processTestimonials(reviews),
recommendedProducts,
})
}
Expand Down

0 comments on commit 6b80d19

Please sign in to comment.