From 6d5c72e81b38fa3861a78c59dedb165607e3f0ac Mon Sep 17 00:00:00 2001 From: arinming Date: Thu, 18 Jul 2024 04:26:54 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[HOTFIX/#117]=20=EA=B3=B5=EA=B3=A0=20?= =?UTF-8?q?=EC=83=81=EC=84=B8=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EB=AA=A8?= =?UTF-8?q?=EB=8D=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/terning/data/dto/response/InternResponseDto.kt | 6 +++--- .../com/terning/domain/entity/response/InternInfoModel.kt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/src/main/java/com/terning/data/dto/response/InternResponseDto.kt b/data/src/main/java/com/terning/data/dto/response/InternResponseDto.kt index 1ffb214fa..a4602a822 100644 --- a/data/src/main/java/com/terning/data/dto/response/InternResponseDto.kt +++ b/data/src/main/java/com/terning/data/dto/response/InternResponseDto.kt @@ -34,8 +34,8 @@ data class InternResponseDto( val detail: String, @SerialName("url") val url: String, - @SerialName("isScrapped") - val isScrapped: Boolean, + @SerialName("scrapId") + val scrapId: Long? = null, ) { fun toInternEntity(): InternInfoModel { return InternInfoModel( @@ -53,7 +53,7 @@ data class InternResponseDto( jobType = jobType, detail = detail, url = url, - isScrapped = isScrapped + scrapId = scrapId ) } } \ No newline at end of file diff --git a/domain/src/main/java/com/terning/domain/entity/response/InternInfoModel.kt b/domain/src/main/java/com/terning/domain/entity/response/InternInfoModel.kt index ec416d2d4..3ad37dbde 100644 --- a/domain/src/main/java/com/terning/domain/entity/response/InternInfoModel.kt +++ b/domain/src/main/java/com/terning/domain/entity/response/InternInfoModel.kt @@ -15,5 +15,5 @@ data class InternInfoModel( val jobType: String, val detail: String, val url: String, - val isScrapped: Boolean, + val scrapId: Long? = null, ) \ No newline at end of file From ccd3083dafbf541f0c0d033422a9f02b223293bb Mon Sep 17 00:00:00 2001 From: arinming Date: Thu, 18 Jul 2024 04:27:05 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[HOTFIX/#117]=20=EA=B3=B5=EA=B3=A0=20?= =?UTF-8?q?=EC=83=81=EC=84=B8=20=EB=B6=88=EB=9F=AC=EC=98=A4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/terning/feature/intern/InternRoute.kt | 5 ++--- .../java/com/terning/feature/intern/InternViewState.kt | 1 - .../terning/feature/intern/component/InternBottomBar.kt | 7 +++---- .../terning/feature/intern/component/ScrapCancelDialog.kt | 1 - 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/intern/InternRoute.kt b/feature/src/main/java/com/terning/feature/intern/InternRoute.kt index 48e74e77f..382768a86 100644 --- a/feature/src/main/java/com/terning/feature/intern/InternRoute.kt +++ b/feature/src/main/java/com/terning/feature/intern/InternRoute.kt @@ -137,8 +137,7 @@ fun InternScreen( InternBottomBar( modifier = modifier, scrapCount = decimal.format(internInfoModel.scrapCount), - url = internInfoModel.url, - isScrappedState = state.isScrappedState, + scrapId = internInfoModel.scrapId, onScrapClick = { viewModel.updateScrapDialogVisible(true) } @@ -369,7 +368,7 @@ fun InternScreen( viewModel.updateScrapDialogVisible(false) }, content = { - when (state.isScrappedState) { + when (internInfoModel.scrapId != null) { true -> ScrapCancelDialogContent() else -> ScrapDialogContent( internInfoList = internInfoList diff --git a/feature/src/main/java/com/terning/feature/intern/InternViewState.kt b/feature/src/main/java/com/terning/feature/intern/InternViewState.kt index dbd63f934..6e696fb45 100644 --- a/feature/src/main/java/com/terning/feature/intern/InternViewState.kt +++ b/feature/src/main/java/com/terning/feature/intern/InternViewState.kt @@ -7,7 +7,6 @@ import com.terning.domain.entity.response.InternInfoModel data class InternViewState( var internInfo: UiState = UiState.Loading, - val isScrap: Boolean = false, val isColorChange: Boolean = false, val selectedColor: Color = CalRed, val isScrapDialogVisible: Boolean = false, diff --git a/feature/src/main/java/com/terning/feature/intern/component/InternBottomBar.kt b/feature/src/main/java/com/terning/feature/intern/component/InternBottomBar.kt index dbe9491e7..093b94bdd 100644 --- a/feature/src/main/java/com/terning/feature/intern/component/InternBottomBar.kt +++ b/feature/src/main/java/com/terning/feature/intern/component/InternBottomBar.kt @@ -33,8 +33,7 @@ import com.terning.feature.intern.InternViewModel fun InternBottomBar( modifier: Modifier, scrapCount: String, - url: String, - isScrappedState: Boolean, + scrapId: Long? = null, onScrapClick: () -> Unit, viewModel: InternViewModel = hiltViewModel(), ) { @@ -68,7 +67,7 @@ fun InternBottomBar( Icon( painter = painterResource( id = - if (isScrappedState) R.drawable.ic_scrap_true_24 + if (scrapId != null) R.drawable.ic_scrap_true_24 else R.drawable.ic_scrap_false_24, ), contentDescription = null, @@ -79,7 +78,7 @@ fun InternBottomBar( .noRippleClickable { onScrapClick() }, - tint = if (state.isScrappedState) TerningMain + tint = if (scrapId != null) TerningMain else Grey350 ) Text( diff --git a/feature/src/main/java/com/terning/feature/intern/component/ScrapCancelDialog.kt b/feature/src/main/java/com/terning/feature/intern/component/ScrapCancelDialog.kt index 2ffc77992..50b44010d 100644 --- a/feature/src/main/java/com/terning/feature/intern/component/ScrapCancelDialog.kt +++ b/feature/src/main/java/com/terning/feature/intern/component/ScrapCancelDialog.kt @@ -96,7 +96,6 @@ fun ScrapCancelDialogContent( cornerRadius = 8.dp, text = R.string.dialog_scrap_cancel_button, onButtonClick = { - viewModel.updateScrapped(!state.isScrappedState) viewModel.updateScrapDialogVisible(false) }, modifier = Modifier.padding(bottom = 8.dp)