Skip to content

Commit

Permalink
Merge pull request #25 from AdultOfNineteen/bug/issue-24
Browse files Browse the repository at this point in the history
[BUG] 재구매 의사 체크한 노트 조회 불가 오류
  • Loading branch information
DongChyeon authored Jan 11, 2024
2 parents c9583c3 + 980337a commit defcbd1
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface TastingNoteDataSource {
order: Int,
countries: List<String>,
wineTypes: List<String>,
buyAgain: Int
buyAgain: Int?
): Flow<ApiResult<ResponseWrapper<PagingResponse<List<TastingNote>>>>>

fun getTastingNoteFilters(): Flow<ApiResult<ResponseWrapper<TastingNoteFilters>>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class TastingNoteDataSourceImpl @Inject constructor(
order: Int,
countries: List<String>,
wineTypes: List<String>,
buyAgain: Int
buyAgain: Int?
): Flow<ApiResult<ResponseWrapper<PagingResponse<List<TastingNote>>>>> =
flow {
emit(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface TastingNoteService {
@Query("order") order: Int,
@Query("countries") countries: List<String>,
@Query("wineTypes") wineTypes: List<String>,
@Query("buyAgain") buyAgain: Int
@Query("buyAgain") buyAgain: Int?
): ApiResult<ResponseWrapper<PagingResponse<List<TastingNote>>>>

/** 테이스팅 노트 필터 목록 조회 API */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class TastingNotesPagingSource(
private val order: Int,
private val countries: List<String>,
private val wineTypes: List<String>,
private val buyAgain: Int
private val buyAgain: Int?
) : PagingSource<Int, TastingNote>() {

override fun getRefreshKey(state: PagingState<Int, TastingNote>): Int? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ interface TastingNoteRepository {
order: Int,
countries: List<String>,
wineTypes: List<String>,
buyAgain: Int
buyAgain: Int?
): Flow<ApiResult<ResponseWrapper<PagingResponse<List<TastingNote>>>>>

fun getTastingNotesCount(
order: Int,
countries: List<String>,
wineTypes: List<String>,
buyAgain: Int
buyAgain: Int?
): Flow<ApiResult<ResponseWrapper<PagingResponse<List<TastingNote>>>>>

fun getTastingNoteFilters(): Flow<ApiResult<ResponseWrapper<TastingNoteFilters>>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ class TastingNoteRepositoryImpl @Inject constructor(
order: Int,
countries: List<String>,
wineTypes: List<String>,
buyAgain: Int
buyAgain: Int?
): Flow<ApiResult<ResponseWrapper<PagingResponse<List<TastingNote>>>>> =
tastingNoteDataSource.getTastingNotes(page, size, order, countries, wineTypes, buyAgain)

override fun getTastingNotesCount(
order: Int,
countries: List<String>,
wineTypes: List<String>,
buyAgain: Int
buyAgain: Int?
): Flow<ApiResult<ResponseWrapper<PagingResponse<List<TastingNote>>>>> =
tastingNoteDataSource.getTastingNotes(1, 1, order, countries, wineTypes, buyAgain)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit defcbd1

Please sign in to comment.