Skip to content

Commit

Permalink
[WEAV-141] company name get,setter 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
jisu15-kim committed Nov 24, 2024
1 parent 077e079 commit dfa0773
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public struct EditProfileCompanyView: View {
}
CTABottomButton(
title: "다음",
isActive: state.searchCompanyState.isValidated
isActive: state.isValidated
) {
/// 회사를 정확하게 파악할 수 있다면 -> 같은 회사 매칭 팝업 보여주기
if !state.searchCompanyState.isNoCompanyHere {
Expand Down Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ extension SearchCompanyIntent: SearchCompanyIntent.Intentable {
}
.store(in: &cancellables)
}

onChangedFocusState(true)
}

public func task() async {}
Expand Down
17 changes: 13 additions & 4 deletions Projects/Model/Model/Sources/Auth/Domain/UserInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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)
}
Expand All @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit dfa0773

Please sign in to comment.