From 1f3265516828b09a260b54716c4bf944b4f2f297 Mon Sep 17 00:00:00 2001 From: Zoran Date: Fri, 2 Feb 2024 08:34:14 +0100 Subject: [PATCH] - fix for my statistics when route difficulty is null [issue169] --- src/activities/services/activity-routes.service.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/activities/services/activity-routes.service.ts b/src/activities/services/activity-routes.service.ts index 76eff7b..a61b33e 100644 --- a/src/activities/services/activity-routes.service.ts +++ b/src/activities/services/activity-routes.service.ts @@ -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');