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 accounts = searchResults.accounts
|
||||||
|
|
||||||
let relationships = try await viewModel.context.apiService.relationship(
|
let relationships: [Mastodon.Entity.Relationship]
|
||||||
forAccounts: accounts,
|
if accounts.isNotEmpty {
|
||||||
authenticationBox: viewModel.authContext.mastodonAuthenticationBox
|
relationships = try await viewModel.context.apiService.relationship(
|
||||||
).value
|
forAccounts: accounts,
|
||||||
|
authenticationBox: viewModel.authContext.mastodonAuthenticationBox
|
||||||
|
).value
|
||||||
|
} else {
|
||||||
|
relationships = []
|
||||||
|
}
|
||||||
|
|
||||||
let statusIDs = searchResults.statuses.map { $0.id }
|
let statusIDs = searchResults.statuses.map { $0.id }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user