Only search for relationships if there are accounts (#1187)
Otherwise this would lead to a `badRequest`
This commit is contained in:
parent
3ee2024c3b
commit
624c3226d5
|
@ -125,10 +125,15 @@ extension SearchResultViewModel.State {
|
|||
|
||||
let accounts = searchResults.accounts
|
||||
|
||||
let relationships = try await viewModel.context.apiService.relationship(
|
||||
let relationships: [Mastodon.Entity.Relationship]
|
||||
if accounts.isNotEmpty {
|
||||
relationships = try await viewModel.context.apiService.relationship(
|
||||
forAccounts: accounts,
|
||||
authenticationBox: viewModel.authContext.mastodonAuthenticationBox
|
||||
).value
|
||||
} else {
|
||||
relationships = []
|
||||
}
|
||||
|
||||
let statusIDs = searchResults.statuses.map { $0.id }
|
||||
|
||||
|
|
Loading…
Reference in New Issue