From 629d65da4822be667a5d03cf0776573f56dd0a25 Mon Sep 17 00:00:00 2001 From: arinming Date: Fri, 9 Feb 2024 16:48:36 +0900 Subject: [PATCH] =?UTF-8?q?FEAT:=20=ED=94=84=EB=A1=9C=ED=95=84=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=ED=8C=8C=ED=8A=B8=20=EC=84=A0=ED=83=9D=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84=20(#104)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/profile/edit/ProfileEditUiState.kt | 1 + .../model/profile/edit/ProfileEditViewModel.kt | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/presentation/src/main/java/com/kusitms/presentation/model/profile/edit/ProfileEditUiState.kt b/presentation/src/main/java/com/kusitms/presentation/model/profile/edit/ProfileEditUiState.kt index 499a649..6371a7c 100644 --- a/presentation/src/main/java/com/kusitms/presentation/model/profile/edit/ProfileEditUiState.kt +++ b/presentation/src/main/java/com/kusitms/presentation/model/profile/edit/ProfileEditUiState.kt @@ -2,4 +2,5 @@ package com.kusitms.presentation.model.profile.edit data class ProfileEditUiState( val currentSelectedProfileFilter: String = "기본 프로필", + val currentSelectedPart: String = "", ) diff --git a/presentation/src/main/java/com/kusitms/presentation/model/profile/edit/ProfileEditViewModel.kt b/presentation/src/main/java/com/kusitms/presentation/model/profile/edit/ProfileEditViewModel.kt index 97048d9..952df35 100644 --- a/presentation/src/main/java/com/kusitms/presentation/model/profile/edit/ProfileEditViewModel.kt +++ b/presentation/src/main/java/com/kusitms/presentation/model/profile/edit/ProfileEditViewModel.kt @@ -102,7 +102,7 @@ class ProfileEditViewModel @Inject constructor( fun updateSelectedPart(part: String) { - _selectedPart.value = part + _selectedPart.value = mapPartToKorean(part) validateFields() } @@ -207,11 +207,19 @@ class ProfileEditViewModel @Inject constructor( if (profileResult.isSuccess) { _detailMemberInfo = profileResult.getOrNull()!! _major.value = _detailMemberInfo.major.toString() + _selectedPart.value = mapPartToKorean(_detailMemberInfo.part.toString()) + detailMemberInfo = _detailMemberInfo } } } - - + private fun mapPartToKorean(part: String): String { + return when (part) { + "PLANNING" -> "기획" + "DESIGN" -> "디자인" + "DEVELOPMENT" -> "개발" + else -> part + } + } } \ No newline at end of file