Skip to content

Commit

Permalink
Fix: handling of absent feedback.scorecnt
Browse files Browse the repository at this point in the history
  • Loading branch information
chanwoonglee committed Aug 1, 2024
1 parent 21e931a commit a585493
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/search/search.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ export class SearchService {
kakaoPlace.blogReviewCnt = feedback.blogrvwcnt;
kakaoPlace.commentCnt = feedback.comntcnt;
kakaoPlace.mainPhotoUrl = basicInfo.mainphotourl;
kakaoPlace.score = feedback.scoresum / feedback.scorecnt;
kakaoPlace.score =
feedback.scorecnt !== 0 ? feedback.scoresum / feedback.scorecnt : 0;
kakaoPlace.openTimeList = (basicInfo.openHour?.periodList || []).flatMap(
(period) => period.timeList,
);
Expand Down

0 comments on commit a585493

Please sign in to comment.