mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-22 08:10:59 +00:00
Formatting
This commit is contained in:
parent
a1b7357312
commit
e8c1db842e
1 changed files with 4 additions and 5 deletions
|
@ -34,11 +34,10 @@ public struct SearchService {
|
||||||
|
|
||||||
extension SearchService: CollectionService {
|
extension SearchService: CollectionService {
|
||||||
public func request(maxId: String?, minId: String?, search: Search?) -> AnyPublisher<Never, Error> {
|
public func request(maxId: String?, minId: String?, search: Search?) -> AnyPublisher<Never, Error> {
|
||||||
guard let search = search else { return Empty().eraseToAnyPublisher() }
|
guard
|
||||||
|
let search = search,
|
||||||
if (search.query.trimmingCharacters(in: .whitespaces).isEmpty){
|
!search.query.trimmingCharacters(in: .whitespaces).isEmpty
|
||||||
return Empty().eraseToAnyPublisher()
|
else { return Empty().eraseToAnyPublisher() }
|
||||||
}
|
|
||||||
|
|
||||||
return mastodonAPIClient.request(ResultsEndpoint.search(search))
|
return mastodonAPIClient.request(ResultsEndpoint.search(search))
|
||||||
.flatMap { results in contentDatabase.insert(results: results).collect().map { _ in results } }
|
.flatMap { results in contentDatabase.insert(results: results).collect().map { _ in results } }
|
||||||
|
|
Loading…
Reference in a new issue