// // APIService+Onboarding.swift // Mastodon // // Created by MainasuK Cirno on 2021-2-19. // import Foundation import Combine import MastodonSDK extension APIService { func servers( language: String?, category: String? ) -> AnyPublisher, Error> { let query = Mastodon.API.Onboarding.ServersQuery(language: language, category: category) return Mastodon.API.Onboarding.servers(session: session, query: query) } func categories() -> AnyPublisher, Error> { return Mastodon.API.Onboarding.categories(session: session) } func stubCategories() -> [Mastodon.Entity.Category] { return Mastodon.Entity.Category.Kind.allCases.map { kind in return Mastodon.Entity.Category(category: kind.rawValue, serversCount: 0) } } }