Change search to use query params in web UI (#32949)
This commit is contained in:
parent
708919ee93
commit
0636bcdbe1
28 changed files with 1396 additions and 1270 deletions
21
app/javascript/mastodon/models/search.ts
Normal file
21
app/javascript/mastodon/models/search.ts
Normal file
|
@ -0,0 +1,21 @@
|
|||
import type { ApiSearchResultsJSON } from 'mastodon/api_types/search';
|
||||
import type { ApiHashtagJSON } from 'mastodon/api_types/tags';
|
||||
|
||||
export type SearchType = 'account' | 'hashtag' | 'accounts' | 'statuses';
|
||||
|
||||
export interface RecentSearch {
|
||||
q: string;
|
||||
type?: SearchType;
|
||||
}
|
||||
|
||||
export interface SearchResults {
|
||||
accounts: string[];
|
||||
statuses: string[];
|
||||
hashtags: ApiHashtagJSON[];
|
||||
}
|
||||
|
||||
export const createSearchResults = (serverJSON: ApiSearchResultsJSON) => ({
|
||||
accounts: serverJSON.accounts.map((account) => account.id),
|
||||
statuses: serverJSON.statuses.map((status) => status.id),
|
||||
hashtags: serverJSON.hashtags,
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue