Skip to content

Commit

Permalink
update text
Browse files Browse the repository at this point in the history
  • Loading branch information
ddusichka committed Dec 4, 2024
1 parent 2598133 commit 47f6188
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions frontend/app/MediaReviewsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const MediaReviewsPage = () => {
const fetchAll = async () => {
try {
const response = await axios.get(
`${BASE_URL}/reviews/${media_type}/${media_id}`
`${BASE_URL}/reviews/${media_type}/${media_id}`,
);
setAllReviews(response.data.reviews);

Expand Down Expand Up @@ -76,7 +76,7 @@ const MediaReviewsPage = () => {
params: {
media_type: media_type,
},
}
},
);

const reviews = response.data;
Expand All @@ -86,7 +86,7 @@ const MediaReviewsPage = () => {
// Calculate the average score
const totalScore = reviews.reduce(
(sum: any, review: { rating: any }) => sum + review.rating,
0
0,
); // Sum of all ratings
const averageScore =
reviews.length > 0 ? totalScore / reviews.length : 0; // Avoid division by 0
Expand All @@ -110,7 +110,7 @@ const MediaReviewsPage = () => {
params: {
media_type: media_type,
},
}
},
);

const reviews = response.data;
Expand All @@ -120,7 +120,7 @@ const MediaReviewsPage = () => {
// Calculate the average score
const totalScore = reviews.reduce(
(sum: any, review: { rating: any }) => sum + review.rating,
0
0,
); // Sum of all ratings
const averageScore =
reviews.length > 0 ? totalScore / reviews.length : 0; // Avoid division by 0
Expand Down Expand Up @@ -181,7 +181,7 @@ const MediaReviewsPage = () => {
<Text style={styles.score}>
{mediaStats.friendScore.toFixed(1)}
</Text>
<Text style={styles.scoreLabel}>Friend Rating</Text>
<Text style={styles.scoreLabel}>Friend Avg Rating</Text>
</View>
)}
{selectedFilter === "all" && (
Expand Down

0 comments on commit 47f6188

Please sign in to comment.