mastodon-ios/Mastodon/Service/APIService/APIService+Search.swift

24 lines
629 B
Swift
Raw Normal View History

2021-03-31 13:29:54 +02:00
//
// APIService+Search.swift
// Mastodon
//
// Created by sxiaojian on 2021/3/31.
//
import Foundation
import MastodonSDK
import Combine
extension APIService {
func search(
domain: String,
2021-04-20 09:40:10 +02:00
query: Mastodon.API.V2.Search.Query,
2021-03-31 13:29:54 +02:00
mastodonAuthenticationBox: AuthenticationService.MastodonAuthenticationBox
) -> AnyPublisher<Mastodon.Response.Content<Mastodon.Entity.SearchResult>, Error> {
let authorization = mastodonAuthenticationBox.userAuthorization
2021-04-20 09:40:10 +02:00
return Mastodon.API.V2.Search.search(session: session, domain: domain, query: query, authorization: authorization)
2021-03-31 13:29:54 +02:00
}
}