diff --git a/app/src/main/java/com/wafflestudio/siksha2/network/SikshaApi.kt b/app/src/main/java/com/wafflestudio/siksha2/network/SikshaApi.kt index 2a6102a3..19e1f5a2 100644 --- a/app/src/main/java/com/wafflestudio/siksha2/network/SikshaApi.kt +++ b/app/src/main/java/com/wafflestudio/siksha2/network/SikshaApi.kt @@ -20,14 +20,14 @@ interface SikshaApi { suspend fun fetchReviews( @Query("menu_id") menuId: Long, @Query("page") page: Long, - @Query("perPage") perPage: Long + @Query("per_page") perPage: Long ): FetchReviewsResult @GET("/reviews/filter") suspend fun fetchReviewsWithImage( @Query("menu_id") menuId: Long, @Query("page") page: Long, - @Query("perPage") perPage: Long, + @Query("per_page") perPage: Long, @Query("etc") etc: Boolean = true ): FetchReviewsResult diff --git a/app/src/main/java/com/wafflestudio/siksha2/ui/menuDetail/MenuReviewPagingSource.kt b/app/src/main/java/com/wafflestudio/siksha2/ui/menuDetail/MenuReviewPagingSource.kt index 8097d4aa..dd031158 100644 --- a/app/src/main/java/com/wafflestudio/siksha2/ui/menuDetail/MenuReviewPagingSource.kt +++ b/app/src/main/java/com/wafflestudio/siksha2/ui/menuDetail/MenuReviewPagingSource.kt @@ -18,7 +18,7 @@ class MenuReviewPagingSource( return try { val response = api.fetchReviews(menuId, key, params.loadSize.toLong()) val prevKey = if (key == 1L) null else key - 1 - val nextKey = if (response.result.isEmpty()) null else key + 1 + val nextKey = if (response.result.isEmpty()) null else if (key == STARTING_PAGE_INDEX) key + params.loadSize / PAGE_LOAD_SIZE else key + 1 LoadResult.Page( response.result, diff --git a/app/src/main/java/com/wafflestudio/siksha2/ui/menuDetail/MenuReviewWithImagePagingSource.kt b/app/src/main/java/com/wafflestudio/siksha2/ui/menuDetail/MenuReviewWithImagePagingSource.kt index 7fc97ee9..776a8543 100644 --- a/app/src/main/java/com/wafflestudio/siksha2/ui/menuDetail/MenuReviewWithImagePagingSource.kt +++ b/app/src/main/java/com/wafflestudio/siksha2/ui/menuDetail/MenuReviewWithImagePagingSource.kt @@ -18,7 +18,7 @@ class MenuReviewWithImagePagingSource( return try { val response = api.fetchReviewsWithImage(menuId, key, params.loadSize.toLong()) val prevKey = if (key == 1L) null else key - 1 - val nextKey = if (response.result.isEmpty()) null else key + 1 + val nextKey = if (response.result.isEmpty()) null else if (key == STARTING_PAGE_INDEX) key + params.loadSize / PAGE_LOAD_SIZE else key + 1 LoadResult.Page( response.result, diff --git a/version.properties b/version.properties index 11fb0a5d..2c0be261 100644 --- a/version.properties +++ b/version.properties @@ -1 +1 @@ -sikshaVersion=3.1.0 \ No newline at end of file +sikshaVersion=3.1.1 \ No newline at end of file