fix: filter out updates with NULL end_date or version (#413)

This commit is contained in:
Lukáš Stankovič
2025-12-29 13:33:48 +01:00
committed by GitHub
parent a974abd10f
commit 340beb9e84

View File

@@ -64,7 +64,7 @@ func TeslaMateAPICarsUpdatesV1(c *gin.Context) {
version
FROM updates
LEFT JOIN cars ON car_id = cars.id
WHERE car_id = $1
WHERE car_id = $1 AND end_date IS NOT NULL AND version IS NOT NULL
ORDER BY start_date DESC
LIMIT $2 OFFSET $3;`
rows, err := db.Query(query, CarID, ResultShow, ResultPage)