Display collection in search results when searched by URL (#39289)
This commit is contained in:
1 parent
085c91bf12
commit
fe4613ba32
6 files changed
+69
-6
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import type { ApiSearchResultsJSON } from 'mastodon/api_types/search';
|
||||
import type { ApiHashtagJSON } from 'mastodon/api_types/tags';
|
||||
import type { ApiCollectionJSON } from '@/mastodon/api_types/collections';
|
||||
import type { ApiSearchResultsJSON } from '@/mastodon/api_types/search';
|
||||
import type { ApiHashtagJSON } from '@/mastodon/api_types/tags';
|
||||
|
||||
export type SearchType = 'account' | 'hashtag' | 'accounts' | 'statuses';
|
||||
|
||||
@@ -12,10 +13,12 @@ export interface SearchResults {
|
||||
accounts: string[];
|
||||
statuses: string[];
|
||||
hashtags: ApiHashtagJSON[];
|
||||
collections: ApiCollectionJSON[];
|
||||
}
|
||||
|
||||
export const createSearchResults = (serverJSON: ApiSearchResultsJSON) => ({
|
||||
accounts: serverJSON.accounts.map((account) => account.id),
|
||||
statuses: serverJSON.statuses.map((status) => status.id),
|
||||
hashtags: serverJSON.hashtags,
|
||||
collections: serverJSON.collections,
|
||||
});
|
||||
Reference in new issue
Block a user