Show correct error for already subscribed error.

This commit is contained in:
Maurice Parker 2020-10-21 14:57:54 -05:00
parent 86edb9aa33
commit 4ad3da30e1

View File

@ -333,7 +333,7 @@ final class ReaderAPICaller: NSObject {
let postData = "T=\(token)&ac=subscribe&s=feed/\(feedURL.absoluteString)&a=user/-/label/\(folder.nameForDisplay)&t=\(name ?? "")".data(using: String.Encoding.utf8)
self.self.transport.send(request: request, method: HTTPMethod.post, payload: postData!, completion: { (result) in
self.transport.send(request: request, method: HTTPMethod.post, payload: postData!, completion: { (result) in
switch result {
case .success:
@ -356,17 +356,16 @@ final class ReaderAPICaller: NSObject {
completion(.success(.created(subscription)))
case .failure:
completion(.failure(AccountError.createErrorAlreadySubscribed))
case .failure(let error):
completion(.failure(error))
}
})
case .failure(let error):
completion(.failure(error))
case .failure:
completion(.failure(AccountError.createErrorAlreadySubscribed))
}
})
case .failure(let error):
completion(.failure(error))
}