From e3177d2199a7bfed62615d0a116b9768d30e781b Mon Sep 17 00:00:00 2001 From: Zoe Date: Thu, 28 Nov 2024 04:22:32 +0900 Subject: [PATCH] =?UTF-8?q?[Fix/#104]=20=EB=B9=8C=EB=93=9C=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Mapper/Challenge/ChallengeDetailMapper.swift | 2 +- .../Sources/Service/Challenge/ChallengeService.swift | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/HMH_Tuist_iOS/Projects/Data/Sources/Mapper/Challenge/ChallengeDetailMapper.swift b/HMH_Tuist_iOS/Projects/Data/Sources/Mapper/Challenge/ChallengeDetailMapper.swift index 6ee75462..b95b36f1 100644 --- a/HMH_Tuist_iOS/Projects/Data/Sources/Mapper/Challenge/ChallengeDetailMapper.swift +++ b/HMH_Tuist_iOS/Projects/Data/Sources/Mapper/Challenge/ChallengeDetailMapper.swift @@ -14,7 +14,7 @@ import Networks extension GetChallengeResult { public func toEntity() -> ChallengeDetail { .init( - statuses: statuses, + statuses: statuses.map{ PointStatusEnum(rawValue: $0) ?? .none}, todayIndex: todayIndex, startDate: startDate, challengeInfo: .init( diff --git a/HMH_Tuist_iOS/Projects/Modules/Networks/Sources/Service/Challenge/ChallengeService.swift b/HMH_Tuist_iOS/Projects/Modules/Networks/Sources/Service/Challenge/ChallengeService.swift index 5c1a33f6..d8544ffa 100644 --- a/HMH_Tuist_iOS/Projects/Modules/Networks/Sources/Service/Challenge/ChallengeService.swift +++ b/HMH_Tuist_iOS/Projects/Modules/Networks/Sources/Service/Challenge/ChallengeService.swift @@ -23,11 +23,12 @@ public protocol ChallengeServiceType { } extension ChallengeService: ChallengeServiceType { + public func getDailyChallenge() -> AnyPublisher { return requestWithResult(.getdailyChallenge) } - public func getSuccesChallenge() -> AnyPublisher { + public func postSuccesChallenge(request: ChallengeSuccessRequest) -> AnyPublisher { return requestWithResult(.postSuccesChallenge) } @@ -65,7 +66,7 @@ public struct StubChallengeService: ChallengeServiceType { .eraseToAnyPublisher() } - public func getSuccesChallenge() -> AnyPublisher { + public func postSuccesChallenge(request: ChallengeSuccessRequest) -> AnyPublisher { return Just(.stub) .setFailureType(to: HMHNetworkError.self) .eraseToAnyPublisher()