diff --git a/app/src/main/java/com/nutriomatic/app/data/remote/api/retrofit/ApiService.kt b/app/src/main/java/com/nutriomatic/app/data/remote/api/retrofit/ApiService.kt index e8526448..b7a7789f 100644 --- a/app/src/main/java/com/nutriomatic/app/data/remote/api/retrofit/ApiService.kt +++ b/app/src/main/java/com/nutriomatic/app/data/remote/api/retrofit/ApiService.kt @@ -243,6 +243,8 @@ interface ApiService { @GET("scanned-nutrition/") suspend fun getNutritionScanByUserId( + @Query("desc") desc: Int = 1, + @Query("sort") sort: String = "created_at", @Query("pageSize") pageSize: Int = 20, @Query("page") page: Int = 1, ): GetNutritionScanByUserIdResponse diff --git a/app/src/main/java/com/nutriomatic/app/data/remote/paging/NutritionScanPagingSource.kt b/app/src/main/java/com/nutriomatic/app/data/remote/paging/NutritionScanPagingSource.kt index 18489cb7..9ad96be8 100644 --- a/app/src/main/java/com/nutriomatic/app/data/remote/paging/NutritionScanPagingSource.kt +++ b/app/src/main/java/com/nutriomatic/app/data/remote/paging/NutritionScanPagingSource.kt @@ -18,7 +18,7 @@ class NutritionScanPagingSource(private val apiService: ApiService) : return try { val position = params.key ?: INITIAL_PAGE_INDEX val responseData = - apiService.getNutritionScanByUserId(params.loadSize, position) + apiService.getNutritionScanByUserId(1, "created_at", params.loadSize, position) LoadResult.Page( data = responseData.nutritionScans,