Skip to content

Commit

Permalink
feat : Add review
Browse files Browse the repository at this point in the history
  • Loading branch information
hoyyChoi committed Sep 1, 2023
1 parent 27c9cdf commit e4f5b07
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions source/component/ShopDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,23 @@ const ShopDetail = ({id, setId, userId, singleShop}) => {
// TODO : add review

postReview(userId, id, content, star);
const updatedReviews = [
...data.reviews,
// const updatedReviews = [
// ...data.reviews,
// {
// userId: userId,
// content: content,
// star: star,
// },
// ];
// setData({...data, reviews: updatedReviews});
setReviewlist([
...reviewlist,
{
userId: userId,
content: content,
star: star,
},
];
setData({...data, reviews: updatedReviews});
]);
setContent('');
setStar(5);
setIsAddReview(false);
Expand Down

0 comments on commit e4f5b07

Please sign in to comment.