Skip to content

Commit

Permalink
Merge pull request #170 from zoranmesec/issue169
Browse files Browse the repository at this point in the history
- fix for my statistics when route difficulty is null [issue169]
  • Loading branch information
demshy authored Feb 2, 2024
2 parents c26f444 + 1f32655 commit 23def55
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/activities/services/activity-routes.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,9 @@ export class ActivityRoutesService {
"(r.publish_status IN ('published', 'in_review') OR (r.publish_status = 'draft' AND ar.user_id = :userId))",
{ userId: currentUser.id },
)
.andWhere(
"coalesce(p.difficulty, r.difficulty) is not null"
)
.groupBy("p.difficulty").addGroupBy(("r.difficulty")).addGroupBy("EXTRACT(YEAR FROM ar.date)").addGroupBy("ar.ascent_type")
.orderBy('coalesce(p.difficulty, r.difficulty)', 'ASC')
.addOrderBy('year', 'ASC');
Expand Down

0 comments on commit 23def55

Please sign in to comment.