Created
February 21, 2019 00:57
-
-
Save ekscrypto/3d7b905d4b2de2def7447026548e79d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension APILoginRequest: APIEndpoint { | |
func endpoint() -> String { | |
return "/api/login" | |
} | |
func dispatch( | |
onSuccess successHandler: @escaping ((_: APILoginSuccessResponse) -> Void), | |
onFailure failureHandler: @escaping ((_: APIRequest.ErrorResponse?, _: Error) -> Void)) { | |
APIRequest.post( | |
request: self, | |
onSuccess: successHandler, | |
onError: failureHandler) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment