mirror of
https://github.com/vide/matedroid.git
synced 2026-01-20 00:03:17 +08:00
fix: show all software updates instead of only 100 (#2)
The TeslaMateAPI updates endpoint supports pagination with `page` and `show` query parameters, defaulting to show=100 results. The app was not passing these parameters, causing users with more than 100 software updates to only see the most recent 100. Fixed by adding pagination parameters to the API interface and passing show=50000 in the repository (same pattern used for charges and drives). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Fixed
|
||||
- **Software Versions**: Show all software updates instead of only the first 100
|
||||
|
||||
## [0.6.1] - 2025-12-22
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -69,6 +69,8 @@ interface TeslamateApi {
|
||||
|
||||
@GET("api/v1/cars/{carId}/updates")
|
||||
suspend fun getUpdates(
|
||||
@Path("carId") carId: Int
|
||||
@Path("carId") carId: Int,
|
||||
@Query("page") page: Int? = null,
|
||||
@Query("show") show: Int? = null
|
||||
): Response<UpdatesResponse>
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ class TeslamateRepository @Inject constructor(
|
||||
suspend fun getUpdates(carId: Int): ApiResult<List<UpdateData>> {
|
||||
return try {
|
||||
val api = getApi() ?: return ApiResult.Error("Server not configured")
|
||||
val response = api.getUpdates(carId)
|
||||
val response = api.getUpdates(carId, page = 1, show = 50000)
|
||||
if (response.isSuccessful) {
|
||||
val updates = response.body()?.data?.updates ?: emptyList()
|
||||
ApiResult.Success(updates)
|
||||
|
||||
Reference in New Issue
Block a user