Skip to content

Commit 8b467e9

Browse files
committed
moneymong-234 fix: 소속 pagination next load 기준 수정
1 parent 3f7a371 commit 8b467e9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

data/src/main/java/com/moneymong/moneymong/data/pagingsource/AgencyPagingSource.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ class AgencyPagingSource(
1818

1919
override suspend fun load(params: LoadParams<Int>): LoadResult<Int, AgencyGetResponse> {
2020
val page = params.key ?: START_PAGE
21-
val size = params.loadSize
22-
return dataSource.getAgencies(page = page, size = size).fold(
21+
val loadSize = params.loadSize
22+
return dataSource.getAgencies(page = page, size = loadSize).fold(
2323
onSuccess = {
2424
LoadResult.Page(
2525
data = it.agencies,
2626
prevKey = null,
27-
nextKey = if (it.agencies.isEmpty()) null else page + 1
27+
nextKey = if (it.agencies.size < loadSize) null else page + 1
2828
)
2929
},
3030
onFailure = {

0 commit comments

Comments
 (0)