Skip to content
This repository has been archived by the owner on Dec 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #165 from vasilenkoigor/UsersLookupByEmail-Endpoint
Browse files Browse the repository at this point in the history
Added missed users.lookupByEmail endpoint
  • Loading branch information
pvzig authored Jul 26, 2019
2 parents dd72c61 + c3817be commit 267cf26
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions SKWebAPI/Sources/Endpoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public enum Endpoint: String {
case usersGetPresence = "users.getPresence"
case usersInfo = "users.info"
case usersList = "users.list"
case usersLookupByEmail = "users.lookupByEmail"
case usersProfileSet = "users.profile.set"
case usersSetActive = "users.setActive"
case usersSetPresence = "users.setPresence"
Expand Down
9 changes: 9 additions & 0 deletions SKWebAPI/Sources/WebAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1138,6 +1138,15 @@ extension WebAPI {
failure?(error)
}
}

public func usersLookupByEmail(_ email: String, success: ((_ user: User) -> Void)?, failure: FailureClosure?) {
let parameters: [String: Any] = ["token": token, "email": email]
networkInterface.request(.usersLookupByEmail, parameters: parameters, successClosure: { response in
success?(User(user: response["user"] as? [String: Any]))
}) { error in
failure?(error)
}
}

public func usersProfileSet(profile: User.Profile, success: SuccessClosure?, failure: FailureClosure?) {
let profileValues = ([
Expand Down

0 comments on commit 267cf26

Please sign in to comment.