diff --git a/feature/src/main/java/com/terning/feature/home/home/component/HomeRecommendInternDialog.kt b/feature/src/main/java/com/terning/feature/home/home/component/HomeRecommendInternDialog.kt index 7813c5323..9738753e9 100644 --- a/feature/src/main/java/com/terning/feature/home/home/component/HomeRecommendInternDialog.kt +++ b/feature/src/main/java/com/terning/feature/home/home/component/HomeRecommendInternDialog.kt @@ -21,6 +21,7 @@ import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.painterResource @@ -52,6 +53,7 @@ import com.terning.feature.intern.component.InternInfoRow fun HomeRecommendInternDialog( internInfoList: List>, clickAction: () -> Unit, + onColorSelected:(Color) -> Unit = {}, homeRecommendInternModel: HomeRecommendInternModel, viewModel: HomeViewModel = hiltViewModel(), ) { @@ -171,6 +173,7 @@ fun HomeRecommendInternDialog( initialColor = CalRed, onColorSelected = { newColor -> viewModel.updateSelectColor(newColor) + onColorSelected(newColor) } ) } diff --git a/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt b/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt index d8dab4e8a..cd804faa6 100644 --- a/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt +++ b/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt @@ -1,5 +1,6 @@ package com.terning.feature.search.searchprocess +import android.util.Log import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -352,12 +353,14 @@ fun SearchProcessScreen( ) viewModel.updateColorChange(false) } else { - viewModel.postScrap(internshipAnnouncementId, 0) - + viewModel.postScrap(internshipAnnouncementId, colorList.indexOf(dialogState.selectedColor)) } viewModel.updateScrapDialogVisible(false) } }, + onColorSelected = { newColor -> + viewModel.updateSelectColor(newColor) + }, homeRecommendInternModel = HomeRecommendInternModel( scrapId = scrapId, internshipAnnouncementId = internshipAnnouncementId,