Skip to content

Commit

Permalink
Feat: saveReview에서 리뷰가 비어있다면 해당 리뷰 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
shlee9999 committed Oct 4, 2024
1 parent 2efd9d8 commit 3cebf06
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/ReviewStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ export default class ReviewStorage {
const existingReview = reviewList.find(item => item.id === review.id);

if (existingReview) {
// 이미 존재하는 리뷰인 경우 editReview 실행
this.editReview(review);
if (review.review === '')
this.removeReview(review.id); // review 파트가 비어있다면 삭제
else this.editReview(review); // 이미 존재하는 리뷰인 경우 editReview 실행
} else {
// 새로운 리뷰인 경우 addReview 실행
this.addReview(review);
Expand Down

0 comments on commit 3cebf06

Please sign in to comment.