From 0bd1adb9ca8c61a96b518b1e8dec3fb5f365aca4 Mon Sep 17 00:00:00 2001 From: JaeWoong Eum Date: Sat, 21 Mar 2026 23:41:41 +0900 Subject: [PATCH] =?UTF-8?q?[BUGFIX]=20=EA=B2=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EB=AA=A8=EB=93=9C=20=EC=8B=9C=20=ED=83=9D=EC=8B=9C=EB=B9=84=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20API=20=ED=98=B8=EC=B6=9C=20=EC=B0=A8?= =?UTF-8?q?=EB=8B=A8=20=EB=A1=9C=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Atcha-iOS/Presentation/Location/MainViewModel.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Atcha-iOS/Presentation/Location/MainViewModel.swift b/Atcha-iOS/Presentation/Location/MainViewModel.swift index 4dd0f46d..66f628cc 100644 --- a/Atcha-iOS/Presentation/Location/MainViewModel.swift +++ b/Atcha-iOS/Presentation/Location/MainViewModel.swift @@ -154,6 +154,7 @@ final class MainViewModel: BaseViewModel{ guard self.isServiceRegion == true, !isGuest else { return } + let req = FetchTaxiFareRequest( originLat: lastReverseGeocode?.lat, originLon: lastReverseGeocode?.lon, @@ -585,6 +586,8 @@ extension MainViewModel { address = info?.name?.isEmpty == false ? info?.name : info?.address + guard self.isServiceRegion == true, !isGuest else { return } + let request = FetchTaxiFareRequest( originLat: info?.lat, originLon: info?.lon, @@ -607,6 +610,10 @@ extension MainViewModel { throw NSError(domain: "StartCoord", code: -1, userInfo: [NSLocalizedDescriptionKey: "저장된 출발 좌표가 유효하지 않습니다."]) } + guard self.isServiceRegion == true && !isGuest else { + throw NSError(domain: "AuthError", code: 401, userInfo: [NSLocalizedDescriptionKey: "게스트는 요금 조회가 불가능합니다."]) + } + let req = FetchTaxiFareRequest( originLat: lat, originLon: lon, @@ -642,6 +649,10 @@ extension MainViewModel { } private func fetchTaxiFare(request: FetchTaxiFareRequest) async throws -> Double { + guard self.isServiceRegion == true && !isGuest else { + throw NSError(domain: "AuthError", code: 401, userInfo: [NSLocalizedDescriptionKey: "게스트는 요금 조회가 불가능합니다."]) + } + return try await fetchTaxiFareUseCase.fetchTaxiFare(request: request) }