mirror of
https://github.com/mastodon/mastodon-ios.git
synced 2025-01-31 09:35:13 +01:00
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(
|
||||
forAccounts: accounts,
|
||||
authenticationBox: viewModel.authContext.mastodonAuthenticationBox
|
||||
).value
|
||||
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…
x
Reference in New Issue
Block a user