Skip to content

Commit

Permalink
fix: 미션 조회 필터값 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
eshc123 committed Oct 27, 2024
1 parent 912bebd commit 9d46b7f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ android {
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
isDebuggable = false
isDebuggable = true
}
}
buildFeatures {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ fun CreateMissionBody.toRequest() : CreateMissionRequest {
fun MissionResponse.toModel() : Mission {
return Mission(
missionId = missionId,
description = description
description = description,
missionStatus = missionStatus
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ package com.goalpanzi.mission_mate.core.domain.onboarding.model

data class Mission(
val missionId : Long,
val description : String
val description : String,
val missionStatus : String
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ import kotlinx.serialization.Serializable
@Serializable
data class MissionResponse(
val missionId : Long,
val description : String
val description : String,
val missionStatus : String
)
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ interface OnboardingService {

@GET("/api/mission-members/me")
suspend fun getJoinedMissions(
@Query("filter") filter : String = "PENDING,ONGOING"
@Query("filter") filter : String = ""
) : Response<MissionsResponse>
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ class OnboardingViewModel @Inject constructor(
when (result) {
is DomainResult.Success -> {
result.data.missions.let { missions ->
if (missions.isNotEmpty() && isJoined != false) {
val missionInProgress = missions.lastOrNull { it.missionStatus == "IN_PROGRESS" }
if (missionInProgress != null) {
_onboardingResultEvent.emit(
OnboardingResultEvent.SuccessWithJoinedMissions(missions.first())
OnboardingResultEvent.SuccessWithJoinedMissions(missionInProgress)
)
} else {
_onboardingUiModel.emit(
Expand Down

0 comments on commit 9d46b7f

Please sign in to comment.