Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ”€ :: 정보 μž…λ ₯ νŽ˜μ΄μ§€μ—μ„œ μž…λ ₯듀에 Validation μ„€μ • #212

Merged
merged 1 commit into from
Jun 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Foundation
import FoundationUtil
import InputCertificateInfoFeatureInterface

final class InputCertificateInfoIntent: InputCertificateInfoIntentProtocol {
Expand Down Expand Up @@ -32,7 +33,8 @@ final class InputCertificateInfoIntent: InputCertificateInfoIntentProtocol {
func nextButtonDidTap(certificates: [String]) {
certificateDelegate?.completeToInputCertificate(
certificates: certificates
.filter { !$0.isEmpty }
.map { $0.trimmingCharacters(in: .whitespacesAndNewlines) }
.filter { $0.isNotEmpty }
)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Foundation
import FoundationUtil
import InputLanguageInfoFeatureInterface
import Validator

Expand Down Expand Up @@ -37,8 +38,13 @@ final class InputLanguageInfoIntent: InputLanguageInfoIntentProtocol {

func completeButtonDidTap(languages: [LanguageInputModel]) {
let tupledLanguages = languages
.filter { !$0.languageName.isEmpty && !$0.languageScore.isEmpty }
.map { (name: $0.languageName, score: $0.languageScore) }
.map {
(
name: $0.languageName.trimmingCharacters(in: .whitespacesAndNewlines),
score: $0.languageScore.trimmingCharacters(in: .whitespacesAndNewlines)
)
}
Comment on lines +41 to +46
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

μ œκ°€ λ³΄κΈ°μ—λŠ” λ³„λ‘œ 쒋은 μŠ€νƒ€μΌμ΄ μ•„λ‹Œκ±° 같은데 λ‹€λ₯Έλ°©μ‹μœΌλ‘œ λ°”κΏ€ 순 μ—†μ„κΉŒμš”? 개인적인 μ£Όκ΄€μž…λ‹ˆλ‹€!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ꡬ쑰체둜 λΊ„κΉŒμš”? ν”„λ‘œνΌν‹° 2개라 νŠœν”Œλ‘œ μ²˜λ¦¬ν•˜κΈ΄ν–ˆμŠ΅λ‹ˆλ‹€

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ꡬ쑰체둜 빼도 많이 쒋아보일거 같지 μ•Šμ•„μ„œ 별 방법이 μ—†μœΌλ©΄ κ·Έλƒ₯ ν•˜μ£ !

.filter { $0.isNotEmpty && $1.isNotEmpty }
languageDelegate?.completeToInputLanguage(languages: tupledLanguages)
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import Foundation
import InputWorkInfoFeatureInterface
import StudentDomainInterface
import Validator
import FoundationUtil

final class InputWorkInfoIntent: InputWorkInfoIntentProtocol {
private weak var model: (any InputWorkInfoActionProtocol)?
Expand All @@ -19,6 +21,8 @@ final class InputWorkInfoIntent: InputWorkInfoIntentProtocol {
}

func updateWorkRegion(region: String, at index: Int) {
let regexValidator = RegexValidator(pattern: "^[κ°€-νž£γ„±-γ…Žγ…-γ…£a-zA-Z0-9]$")
guard regexValidator.validate(region) || region.isEmpty else { return }
model?.updateWorkRegion(region: region, at: index)
}

Expand Down Expand Up @@ -51,7 +55,8 @@ final class InputWorkInfoIntent: InputWorkInfoIntentProtocol {
formOfEmployment: state.formOfEmployment.rawValue,
salary: Int(state.salary) ?? 0,
workRegion: state.workRegionList
.filter { !$0.isEmpty }
.map { $0.trimmingCharacters(in: .whitespacesAndNewlines) }
.filter { $0.isNotEmpty }
)
inputWorkDelegate?.completeToInputWork(input: input)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Foundation

public extension String {
var isNotEmpty: Bool {
!self.isEmpty
}
}