feat: upgrade to masto.js v6 (#2530)

This commit is contained in:
patak 2024-01-09 09:56:15 +01:00 committed by GitHub
parent d8ea685803
commit 6c5bb83ac3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
62 changed files with 262 additions and 263 deletions

View file

@ -43,7 +43,9 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
}
// If we're logged in, search for the local id the account or status corresponds to
const { accounts, statuses } = await masto.client.value.v2.search({ q: `https:/${to.fullPath}`, resolve: true, limit: 1 })
const paginator = masto.client.value.v2.search.list({ q: `https:/${to.fullPath}`, resolve: true, limit: 1 })
const { accounts, statuses } = (await paginator.next()).value ?? { accounts: [], statuses: [] }
if (statuses[0])
return getStatusRoute(statuses[0])