Skip to content

Commit

Permalink
feeedback fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DFanso committed Jan 7, 2024
1 parent 9d61c94 commit b60beed
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions client/src/components/pages/Movie.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { useLoading } from "../LoadingContext.js";
import { Link } from "react-router-dom";
import Swal from "sweetalert2";
import Chat from "../Chat";
import { HttpStatusCode } from "axios";

const MovieFeedbackForm = () => {
var { id } = useParams();
Expand Down Expand Up @@ -137,11 +138,11 @@ function MoviePage() {
const feedbackResponse = await fetch(
`${process.env.REACT_APP_API_PATH}/feedbacks/movie/${id}`
);
if (!feedbackResponse.ok) {
throw new Error(`HTTP error! Status: ${feedbackResponse.status}`);
if (feedbackResponse.ok) {

const feedbackData = await feedbackResponse.json();
setFeedbacks(feedbackData);
}
const feedbackData = await feedbackResponse.json();
setFeedbacks(feedbackData);
} catch (error) {
Swal.fire({
title: "Error!",
Expand Down

0 comments on commit b60beed

Please sign in to comment.