|
console.log(reviewObject) |
|
if (!reviewObject.rating) { |
|
alert("Please select a rating") |
|
} else if (reviewObject.summary.length > 60) { |
|
alert("Review headline must be less than 60 characters") |
|
// } else if (reviewObject.body.length > 1000 || reviewObject.body.length < 50) { |
|
// alert("Review must be between 50 and 1000 characters") |
|
} else if (!reviewObject.recommend) { |
|
alert("Please select a recommendation") |
|
} else if (!reviewObject.name) { |
|
alert("Please fill in your username") |
|
} else if (!reviewObject.email) { |
|
alert("Please fill in your email address") |
Just a few things that could be tidied up here - extra whitespace lines, unnecessary console.logs that were used in development.
Finding another way to point out the user input errors instead of using alerts would be a good improvement as well (time permitting!).
Project_Catwalk/client/src/components/Reviews/reviewModal.jsx
Lines 29 to 41 in 844804d
Just a few things that could be tidied up here - extra whitespace lines, unnecessary console.logs that were used in development.
Finding another way to point out the user input errors instead of using alerts would be a good improvement as well (time permitting!).