diff --git a/Projects/Features/Home/Sources/Profile/EditProfile/EditProfileCompany/EditProfileCompanyIntent.swift b/Projects/Features/Home/Sources/Profile/EditProfile/EditProfileCompany/EditProfileCompanyIntent.swift index 1ef8c0b..75168f0 100644 --- a/Projects/Features/Home/Sources/Profile/EditProfile/EditProfileCompany/EditProfileCompanyIntent.swift +++ b/Projects/Features/Home/Sources/Profile/EditProfile/EditProfileCompany/EditProfileCompanyIntent.swift @@ -71,10 +71,10 @@ extension EditProfileCompanyIntent: EditProfileCompanyIntent.Intentable { ) { Task { do { - guard let company = state.selectedCompany else { return } + let company = state.selectedCompany model?.setLoading(status: true) var newUserInfo = input.userInfo - newUserInfo.profile.companyId = company.id + newUserInfo.profile.companyId = company?.id newUserInfo.dreamPartner.allowSameCompany = state.sameCompanyMatchingAvailable try await requestPutProfile(newUserInfo: newUserInfo) model?.setLoading(status: false) diff --git a/Projects/Features/Home/Sources/Profile/EditProfile/EditProfileCompany/EditProfileCompanyView.swift b/Projects/Features/Home/Sources/Profile/EditProfile/EditProfileCompany/EditProfileCompanyView.swift index 4ade9bd..1d9c5b3 100644 --- a/Projects/Features/Home/Sources/Profile/EditProfile/EditProfileCompany/EditProfileCompanyView.swift +++ b/Projects/Features/Home/Sources/Profile/EditProfile/EditProfileCompany/EditProfileCompanyView.swift @@ -106,7 +106,7 @@ public struct EditProfileCompanyView: View { } CTABottomButton( title: "다음", - isActive: state.searchCompanyState.isValidated + isActive: state.isValidated ) { /// 회사를 정확하게 파악할 수 있다면 -> 같은 회사 매칭 팝업 보여주기 if !state.searchCompanyState.isNoCompanyHere { @@ -138,59 +138,3 @@ public struct EditProfileCompanyView: View { EditProfileCompanyView(userInfo: .mock) } } - -//ZStack { -// VStack { -// if let userInfo = state.userInfo { -// HStack { -// Text("💼 내 직군") -// .typography(.regular_12) -// Text(userInfo.profile.jobOccupation) -// .pretendard( -// weight: ._600, -// size: 12 -// ) -// } -// .foregroundStyle(DesignCore.Colors.grey400) -// .padding(.horizontal, 20) -// .padding(.vertical, 10) -// .background( -// Capsule() -// .fill(DesignCore.Colors.yellow50) -// .stroke( -// Color(hex: 0xEDE9C1), -// lineWidth: 1 -// ) -// ) -// .padding(.vertical, 10) -// } -// JobSelectionView( -// selected: [state.singleSelectedJob].compactMap { $0 } -// ) { job in -// intent.onTapJobOccupation( -// selectedJob: job -// ) -// } -// .padding(.bottom, 90) -// } -// -// CTABottomButton( -// title: "다음", -// isActive: state.isValidated -// ) { -// intent.onTapNextButton(state: state) -// } -//} -//.task { -// await intent.task() -//} -//.onAppear { -// intent.onAppear() -//} -//.ignoresSafeArea(.keyboard) -//.navigationTitle("직군 수정") -//.textureBackground() -//.setPopNavigation { -// AppCoordinator.shared.pop() -//} -//.setLoading(state.isLoading) diff --git a/Projects/Features/SearchCompany/Sources/SearchCompanyIntent.swift b/Projects/Features/SearchCompany/Sources/SearchCompanyIntent.swift index c94a40e..6177cd2 100644 --- a/Projects/Features/SearchCompany/Sources/SearchCompanyIntent.swift +++ b/Projects/Features/SearchCompany/Sources/SearchCompanyIntent.swift @@ -83,6 +83,8 @@ extension SearchCompanyIntent: SearchCompanyIntent.Intentable { } .store(in: &cancellables) } + + onChangedFocusState(true) } public func task() async {} diff --git a/Projects/Model/Model/Sources/Auth/Domain/UserInfo.swift b/Projects/Model/Model/Sources/Auth/Domain/UserInfo.swift index f471446..ff52825 100644 --- a/Projects/Model/Model/Sources/Auth/Domain/UserInfo.swift +++ b/Projects/Model/Model/Sources/Auth/Domain/UserInfo.swift @@ -71,7 +71,7 @@ public struct UserInfoProfile: Hashable, Identifiable, Equatable { if lhs.gender != rhs.gender { return false } if lhs.birthYear != rhs.birthYear { return false } if lhs.companyId != rhs.companyId { return false } - if lhs.companyName != rhs.companyName { return false } + if lhs._companyName != rhs._companyName { return false } if lhs.jobOccupation != rhs.jobOccupation { return false } if lhs.jobOccupationRawValue != rhs.jobOccupationRawValue { return false } if lhs.locations != rhs.locations { return false } @@ -83,11 +83,20 @@ public struct UserInfoProfile: Hashable, Identifiable, Equatable { public let gender: GenderType public let birthYear: Int public var companyId: String? - public var companyName: String? + private var _companyName: String? public let jobOccupation: String public var jobOccupationRawValue: String public var locations: [LocationModel] + public var companyName: String { + set { + _companyName = newValue + } + get { + return _companyName ?? "새회사" + } + } + public var jobOccupationDTO: Components.Schemas.JobOccupation? { return .init(rawValue: jobOccupationRawValue) } @@ -104,7 +113,7 @@ public struct UserInfoProfile: Hashable, Identifiable, Equatable { self.gender = gender self.birthYear = birthYear self.companyId = companyId - self.companyName = companyName + self._companyName = companyName self.jobOccupation = jobOccupation self.jobOccupationRawValue = jobOccupationRawValue self.locations = locations @@ -114,7 +123,7 @@ public struct UserInfoProfile: Hashable, Identifiable, Equatable { self.gender = dto.gender == .MALE ? .male : .female self.birthYear = dto.birthYear self.companyId = dto.company?.id - self.companyName = dto.company?.display + self._companyName = dto.company?.display self.jobOccupation = dto.jobOccupation.display self.jobOccupationRawValue = dto.jobOccupation.code.rawValue self.locations = dto.locations.map {