diff --git a/data/src/main/java/com/teamwiney/data/datasource/tastingnote/TastingNoteDataSource.kt b/data/src/main/java/com/teamwiney/data/datasource/tastingnote/TastingNoteDataSource.kt index 26865e84..022d47ba 100644 --- a/data/src/main/java/com/teamwiney/data/datasource/tastingnote/TastingNoteDataSource.kt +++ b/data/src/main/java/com/teamwiney/data/datasource/tastingnote/TastingNoteDataSource.kt @@ -22,7 +22,7 @@ interface TastingNoteDataSource { order: Int, countries: List, wineTypes: List, - buyAgain: Int + buyAgain: Int? ): Flow>>>> fun getTastingNoteFilters(): Flow>> diff --git a/data/src/main/java/com/teamwiney/data/datasource/tastingnote/TastingNoteDataSourceImpl.kt b/data/src/main/java/com/teamwiney/data/datasource/tastingnote/TastingNoteDataSourceImpl.kt index a213fe3c..52ce549d 100644 --- a/data/src/main/java/com/teamwiney/data/datasource/tastingnote/TastingNoteDataSourceImpl.kt +++ b/data/src/main/java/com/teamwiney/data/datasource/tastingnote/TastingNoteDataSourceImpl.kt @@ -35,7 +35,7 @@ class TastingNoteDataSourceImpl @Inject constructor( order: Int, countries: List, wineTypes: List, - buyAgain: Int + buyAgain: Int? ): Flow>>>> = flow { emit( diff --git a/data/src/main/java/com/teamwiney/data/network/service/TastingNoteService.kt b/data/src/main/java/com/teamwiney/data/network/service/TastingNoteService.kt index 13bb9012..8c1c0edd 100644 --- a/data/src/main/java/com/teamwiney/data/network/service/TastingNoteService.kt +++ b/data/src/main/java/com/teamwiney/data/network/service/TastingNoteService.kt @@ -33,7 +33,7 @@ interface TastingNoteService { @Query("order") order: Int, @Query("countries") countries: List, @Query("wineTypes") wineTypes: List, - @Query("buyAgain") buyAgain: Int + @Query("buyAgain") buyAgain: Int? ): ApiResult>>> /** 테이스팅 노트 필터 목록 조회 API */ diff --git a/data/src/main/java/com/teamwiney/data/pagingsource/TastingNotesPagingSource.kt b/data/src/main/java/com/teamwiney/data/pagingsource/TastingNotesPagingSource.kt index d61feeed..fc8d7190 100644 --- a/data/src/main/java/com/teamwiney/data/pagingsource/TastingNotesPagingSource.kt +++ b/data/src/main/java/com/teamwiney/data/pagingsource/TastingNotesPagingSource.kt @@ -13,7 +13,7 @@ class TastingNotesPagingSource( private val order: Int, private val countries: List, private val wineTypes: List, - private val buyAgain: Int + private val buyAgain: Int? ) : PagingSource() { override fun getRefreshKey(state: PagingState): Int? { diff --git a/data/src/main/java/com/teamwiney/data/repository/tastingnote/TastingNoteRepository.kt b/data/src/main/java/com/teamwiney/data/repository/tastingnote/TastingNoteRepository.kt index 00e77c4a..4bde3ecc 100644 --- a/data/src/main/java/com/teamwiney/data/repository/tastingnote/TastingNoteRepository.kt +++ b/data/src/main/java/com/teamwiney/data/repository/tastingnote/TastingNoteRepository.kt @@ -22,14 +22,14 @@ interface TastingNoteRepository { order: Int, countries: List, wineTypes: List, - buyAgain: Int + buyAgain: Int? ): Flow>>>> fun getTastingNotesCount( order: Int, countries: List, wineTypes: List, - buyAgain: Int + buyAgain: Int? ): Flow>>>> fun getTastingNoteFilters(): Flow>> diff --git a/data/src/main/java/com/teamwiney/data/repository/tastingnote/TastingNoteRepositoryImpl.kt b/data/src/main/java/com/teamwiney/data/repository/tastingnote/TastingNoteRepositoryImpl.kt index 8eb10363..25a82904 100644 --- a/data/src/main/java/com/teamwiney/data/repository/tastingnote/TastingNoteRepositoryImpl.kt +++ b/data/src/main/java/com/teamwiney/data/repository/tastingnote/TastingNoteRepositoryImpl.kt @@ -39,7 +39,7 @@ class TastingNoteRepositoryImpl @Inject constructor( order: Int, countries: List, wineTypes: List, - buyAgain: Int + buyAgain: Int? ): Flow>>>> = tastingNoteDataSource.getTastingNotes(page, size, order, countries, wineTypes, buyAgain) @@ -47,7 +47,7 @@ class TastingNoteRepositoryImpl @Inject constructor( order: Int, countries: List, wineTypes: List, - buyAgain: Int + buyAgain: Int? ): Flow>>>> = tastingNoteDataSource.getTastingNotes(1, 1, order, countries, wineTypes, buyAgain) diff --git a/feature/note/src/main/java/com/teamwiney/notecollection/NoteViewModel.kt b/feature/note/src/main/java/com/teamwiney/notecollection/NoteViewModel.kt index dfcbe1f7..08f8db52 100644 --- a/feature/note/src/main/java/com/teamwiney/notecollection/NoteViewModel.kt +++ b/feature/note/src/main/java/com/teamwiney/notecollection/NoteViewModel.kt @@ -54,7 +54,7 @@ class NoteViewModel @Inject constructor( order = currentState.selectedSort, countries = currentState.selectedCountryFilter.map { it.country }, wineTypes = currentState.selectedTypeFilter.map { convertToWineType(it.type) }, - buyAgain = if (currentState.buyAgainSelected) 1 else 0 + buyAgain = if (currentState.buyAgainSelected) 1 else null ) } ).flow.cachedIn(viewModelScope).onStart { @@ -71,7 +71,7 @@ class NoteViewModel @Inject constructor( order = currentState.selectedSort, countries = currentState.selectedCountryFilter.map { it.country }, wineTypes = currentState.selectedTypeFilter.map { convertToWineType(it.type) }, - buyAgain = if (currentState.buyAgainSelected) 1 else 0 + buyAgain = if (currentState.buyAgainSelected) 1 else null ).onStart { updateState(currentState.copy(isLoading = true)) }.collectLatest {