From 228270a4b7b742443bf18309201eb8885f0e825d Mon Sep 17 00:00:00 2001 From: Konrad Feiler Date: Wed, 14 Jul 2021 19:43:55 -0600 Subject: [PATCH 1/2] add user detail get method --- Sources/SwifterUsers.swift | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Sources/SwifterUsers.swift b/Sources/SwifterUsers.swift index 252001da..23a71f5c 100644 --- a/Sources/SwifterUsers.swift +++ b/Sources/SwifterUsers.swift @@ -41,6 +41,25 @@ public extension Swifter { }, failure: failure) } + /** + GET users/show + + Returns user info (including name, location, description, isVerified, profileImage) for the authenticating user. + */ + func getUserDetails(for userTag: UserTag, + success: SuccessHandler? = nil, + failure: FailureHandler? = nil) { + let path = "users/show.json" + + var parameters = [String: Any]() + parameters[userTag.key] = userTag.value + parameters["include_entities"] ??= false + + self.getJSON(path: path, baseURL: .api, parameters: parameters, success: { json, _ in + success?(json) + }, failure: failure) + } + /** GET account/verify_credentials From 38bb5ef24983b35d4d21314ea09e4c24e071a06c Mon Sep 17 00:00:00 2001 From: Konrad Feiler Date: Wed, 14 Jul 2021 19:48:48 -0600 Subject: [PATCH 2/2] documentation typo --- Sources/SwifterUsers.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SwifterUsers.swift b/Sources/SwifterUsers.swift index 23a71f5c..5e17cee4 100644 --- a/Sources/SwifterUsers.swift +++ b/Sources/SwifterUsers.swift @@ -44,7 +44,7 @@ public extension Swifter { /** GET users/show - Returns user info (including name, location, description, isVerified, profileImage) for the authenticating user. + Returns user info (including name, location, description, isVerified, profileImage) for the requested user. */ func getUserDetails(for userTag: UserTag, success: SuccessHandler? = nil,