feat: upgrade to masto.js v6 (#2530)
This commit is contained in:
parent
d8ea685803
commit
6c5bb83ac3
62 changed files with 262 additions and 263 deletions
|
@ -1,9 +1,9 @@
|
|||
import type { MaybeRefOrGetter } from '@vueuse/core'
|
||||
import type { Paginator, mastodon } from 'masto'
|
||||
import type { mastodon } from 'masto'
|
||||
import type { RouteLocation } from 'vue-router'
|
||||
|
||||
export type UseSearchOptions = MaybeRefOrGetter<
|
||||
Partial<Omit<mastodon.v1.SearchParams, keyof mastodon.DefaultPaginationParams | 'q'>>
|
||||
Partial<Omit<mastodon.rest.v2.SearchParams, keyof mastodon.DefaultPaginationParams | 'q'>>
|
||||
>
|
||||
|
||||
export interface BuildSearchResult<K extends keyof any, T> {
|
||||
|
@ -30,7 +30,7 @@ export function useSearch(query: MaybeRefOrGetter<string>, options: UseSearchOpt
|
|||
|
||||
const q = $computed(() => resolveUnref(query).trim())
|
||||
|
||||
let paginator: Paginator<mastodon.v2.Search, mastodon.v2.SearchParams> | undefined
|
||||
let paginator: mastodon.Paginator<mastodon.v2.Search, mastodon.rest.v2.SearchParams> | undefined
|
||||
|
||||
const appendResults = (results: mastodon.v2.Search, empty = false) => {
|
||||
if (empty) {
|
||||
|
@ -72,7 +72,7 @@ export function useSearch(query: MaybeRefOrGetter<string>, options: UseSearchOpt
|
|||
* Based on the source it seems like modifying the params when calling next would result in a new search,
|
||||
* but that doesn't seem to be the case. So instead we just create a new paginator with the new params.
|
||||
*/
|
||||
paginator = client.v2.search({
|
||||
paginator = client.v2.search.list({
|
||||
q,
|
||||
...resolveUnref(options),
|
||||
resolve: !!currentUser.value,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue