Skip to content

Commit

Permalink
🪛[chore] : 모듈 분리 작업
Browse files Browse the repository at this point in the history
  • Loading branch information
Byeonjinha committed Nov 4, 2023
1 parent 891b885 commit b9fd04e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ public enum Source: String {
public var type: SourceType {
switch self {
case .greatman:
return SourceType(english: "greatMan", korean: "위인", bread: .plainBread, smallIconImageName: "greatmanImage")
return SourceType(english: "greatman", korean: "위인", bread: .plainBread, smallIconImageName: "greatmanImage")
case .celeb:
return SourceType(english: "famous", korean: "유명인", bread: .croissant, smallIconImageName: "celeImage")
return SourceType(english: "celeb", korean: "유명인", bread: .croissant, smallIconImageName: "celeImage")
case .anime:
return SourceType(english: "animation", korean: "애니메이션", bread: .cookie, smallIconImageName: "animeImage")
return SourceType(english: "anime", korean: "애니메이션", bread: .cookie, smallIconImageName: "animeImage")
case .film:
return SourceType(english: "film", korean: "드라마/영화", bread: .pancake, smallIconImageName: "filmImage")
case .book:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ public struct ArchiveView: View {
.pretendardFont(family: .Medium, size: 14)
.onTapGesture {
if archiveViewViewModel.isAscendingOrder {
viewModel.cards.sort { $0.title < $1.title }
archiveViewViewModel.bookmarkCards.sort { $0.title < $1.title }
} else {
viewModel.cards.sort { $0.title > $1.title }
archiveViewViewModel.bookmarkCards.sort { $0.title > $1.title }
}
archiveViewViewModel.isAscendingOrder.toggle()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,13 @@ public class BakeViewModel: ObservableObject {
})
}

public func getHashtags(post: BakeModel) -> Hashtags {
let flavor = Flavor(rawValue: post.data?.flavor ?? "")!
let source = Source(rawValue: post.data?.source ?? "")!
let mood = Mood(rawValue: post.data?.mood ?? "")!
public func getHashtags(post: BakeModel) -> Hashtags? {
guard let flavor = Flavor(rawValue: post.data?.flavor ?? ""),
let source = Source(rawValue: post.data?.source ?? ""),
let mood = Mood(rawValue: post.data?.mood ?? "")
else {
return nil
}

return Hashtags(flavor: flavor, source: source, mood: mood)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,13 @@ private extension ModalView {
.foregroundColor(.basicWhite)
)
.onTapGesture {
let situationParameter: [String] = generateParameter(searchType: .situation)
let moodParameter: [String] = generateParameter(searchType: .situation)
let flavorParameter: [String] = generateParameter(searchType: .flavor)
let sourceParameter: [String] = generateParameter(searchType: .source)
print(situationParameter, flavorParameter, sourceParameter, viewModel.exploreViewSearchBarText)
print(moodParameter, flavorParameter, sourceParameter, viewModel.exploreViewSearchBarText)

Task {
await exploreViewViewModel.searchRequest(keyword: viewModel.exploreViewSearchBarText, flavors: flavorParameter, sources: sourceParameter, mood: situationParameter, orderBy: "") {
await exploreViewViewModel.searchRequest(keyword: viewModel.exploreViewSearchBarText, flavors: flavorParameter, sources: sourceParameter, mood: moodParameter, orderBy: "") {
viewModel.searchedCards = []

for quoteContent in exploreViewViewModel.searchModel?.data?.content ?? [] {
Expand Down

0 comments on commit b9fd04e

Please sign in to comment.