Fix stats endpoint returning null for totalPointsTracked

This commit is contained in:
Eugene Burmakin 2025-10-04 15:53:25 +02:00
parent eb4f5d6e1b
commit 6648d9e593
2 changed files with 7 additions and 1 deletions

View file

@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
# [UNRELEASED]
## Fixed
- `GET /api/v1/stats` endpoint now returns correct 0 instead of null if no points were tracked in the requested period.
# [0.33.0] - 2025-09-29
## Fixed

View file

@ -10,7 +10,7 @@ class StatsSerializer
def call
{
totalDistanceKm: total_distance_km,
totalPointsTracked: user.points_count,
totalPointsTracked: user.points_count.to_i,
totalReverseGeocodedPoints: reverse_geocoded_points,
totalCountriesVisited: user.countries_visited.count,
totalCitiesVisited: user.cities_visited.count,