Skip to content

Commit

Permalink
fix(profile): set default value for the average rating (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuruyia authored Jan 25, 2024
1 parent 4eb5650 commit 73ddd03
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ interface ProfileRepository : ReactiveCrudRepository<Profile, UUID> {
(SELECT COUNT(*)
FROM evaluation
WHERE user_id = :userId) as nb_reviews,
(SELECT AVG(score)
COALESCE((SELECT AVG(score)
FROM evaluation
WHERE user_id = :userId) as avg_rating;
WHERE user_id = :userId), 0) as avg_rating;
"""
)
fun getProfileStatsOfUser(userId: UUID): Mono<ProfileStats>
Expand Down

0 comments on commit 73ddd03

Please sign in to comment.