From 0a7c35d77a31b53bbf0290e4ab0131d3edcde795 Mon Sep 17 00:00:00 2001 From: Maxime Marinel Date: Thu, 8 Feb 2024 08:10:13 +0100 Subject: [PATCH] Remove comment --- .../Sources/WallabagKit/WallabagKit.swift | 62 ------------------- 1 file changed, 62 deletions(-) diff --git a/WallabagKit/Sources/WallabagKit/WallabagKit.swift b/WallabagKit/Sources/WallabagKit/WallabagKit.swift index 6521f452..7e6f0ba6 100644 --- a/WallabagKit/Sources/WallabagKit/WallabagKit.swift +++ b/WallabagKit/Sources/WallabagKit/WallabagKit.swift @@ -69,70 +69,8 @@ public class WallabagKit { try handleStatusCode(from: response, with: data) return try decoder.decode(T.Object.self, from: data) - -// fetch(to: to) -// .decode(type: T.self, decoder: decoder) -// .mapErrorToWallabagKitError() -// .eraseToAnyPublisher() } - // private func fetch(to: WallabagKitEndpoint) -> AnyPublisher { - // session.dataTaskPublisher(for: request(for: to, withAuth: true)) - // .tryMap { data, response in - // guard let response = response as? HTTPURLResponse else { fatalError() } - // - // try self.handleStatusCode(from: response, with: data) - // - // return data - // } - // .tryCatch { error in - // self.requestToken() - // .tryMap { token -> AnyPublisher in - // if token != nil { - // return self.fetch(to: to) - // } - // throw WallabagKitError.invalidToken - // } - // .mapError { error in WallabagKitError.wrap(error: error) } - // .switchToLatest() - // .eraseToAnyPublisher() - // } - // .mapErrorToWallabagKitError() - // .eraseToAnyPublisher() - // } - -// public func send(to: WallabagKitEndpoint) -> AnyPublisher { -// fetch(to: to) -// .decode(type: T.self, decoder: decoder) -// .mapErrorToWallabagKitError() -// .eraseToAnyPublisher() -// } - -// private func fetch(to: WallabagKitEndpoint) -> AnyPublisher { -// session.dataTaskPublisher(for: request(for: to, withAuth: true)) -// .tryMap { data, response in -// guard let response = response as? HTTPURLResponse else { fatalError() } -// -// try self.handleStatusCode(from: response, with: data) -// -// return data -// } -// .tryCatch { error in -// self.requestToken() -// .tryMap { token -> AnyPublisher in -// if token != nil { -// return self.fetch(to: to) -// } -// throw WallabagKitError.invalidToken -// } -// .mapError { error in WallabagKitError.wrap(error: error) } -// .switchToLatest() -// .eraseToAnyPublisher() -// } -// .mapErrorToWallabagKitError() -// .eraseToAnyPublisher() -// } - public func request(for endpoint: any WallabagKitEndpoint, withAuth: Bool = false) -> URLRequest { var urlRequest = URLRequest(url: URL(string: "\(host)\(endpoint.endpoint())")!) urlRequest.httpMethod = endpoint.method().rawValue