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) }