Skip to content

Instantly share code, notes, and snippets.

@ekscrypto
Created February 21, 2019 00:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ekscrypto/3d7b905d4b2de2def7447026548e79d1 to your computer and use it in GitHub Desktop.
Save ekscrypto/3d7b905d4b2de2def7447026548e79d1 to your computer and use it in GitHub Desktop.
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