Last active
May 31, 2022 18:47
-
-
Save ertembiyik/e4fc0374714f56f06c01cfb02eea75ec to your computer and use it in GitHub Desktop.
This file contains hidden or 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
static func searchBy(id: Int, completion: @escaping(Character?, Error?) -> ()) { | |
manager.sendRequest(route: Self.id(id), decodeTo: Character.self) { completion($0, $1)} | |
} | |
static func searchWith(filters: [Filters], completion: @escaping([Character]?, Error?) -> ()) { | |
struct SearchWithFiltersResponse: Decodable { | |
let info: Info | |
let results: [Character] | |
} | |
manager.sendRequest(route: Self.base(filters), decodeTo: SearchWithFiltersResponse.self) { completion($0?.results, $1)} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment