Organisation getter
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 GitKit { | |
public class func getMyOrganisations() -> Observable<[Organisation]> { | |
guard let organisationsURL = GitKit.currentUser.value?.organizationsUrl else { return [] } | |
return Alamofire.request(.GET, (organisationsURL)) | |
.rx_responseJSON() | |
.map { response, json in | |
guard let array = json as? [[String:AnyObject]] else { return [] } | |
return array.map { [unowned self] json in | |
return Organisation(json: array) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment