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
|
@ -72,7 +72,7 @@ async function deleteStatus() {
|
|||
return
|
||||
|
||||
removeCachedStatus(status.id)
|
||||
await client.v1.statuses.remove(status.id)
|
||||
await client.v1.statuses.$select(status.id).remove()
|
||||
|
||||
if (route.name === 'status')
|
||||
router.back()
|
||||
|
@ -96,7 +96,7 @@ async function deleteAndRedraft() {
|
|||
}
|
||||
|
||||
removeCachedStatus(status.id)
|
||||
await client.v1.statuses.remove(status.id)
|
||||
await client.v1.statuses.$select(status.id).remove()
|
||||
await openPublishDialog('dialog', await getDraftFromStatus(status), true)
|
||||
|
||||
// Go to the new status, if the page is the old status
|
||||
|
|
|
@ -6,7 +6,7 @@ const type = ref<'favourited-by' | 'boosted-by'>('favourited-by')
|
|||
const { client } = $(useMasto())
|
||||
|
||||
function load() {
|
||||
return client.v1.statuses[type.value === 'favourited-by' ? 'listFavouritedBy' : 'listRebloggedBy'](favouritedBoostedByStatusId.value!)
|
||||
return client.v1.statuses.$select(favouritedBoostedByStatusId.value!)[type.value === 'favourited-by' ? 'favouritedBy' : 'rebloggedBy'].list()
|
||||
}
|
||||
|
||||
const paginator = $computed(() => load())
|
||||
|
|
|
@ -36,7 +36,7 @@ async function vote(e: Event) {
|
|||
|
||||
cacheStatus({ ...status, poll }, undefined, true)
|
||||
|
||||
await client.v1.polls.vote(poll.id, { choices })
|
||||
await client.v1.polls.$select(poll.id).votes.create({ choices })
|
||||
}
|
||||
|
||||
const votersCount = $computed(() => poll.votersCount ?? poll.votesCount ?? 0)
|
||||
|
|
|
@ -6,7 +6,7 @@ const { status } = defineProps<{
|
|||
status: mastodon.v1.Status
|
||||
}>()
|
||||
|
||||
const paginator = useMastoClient().v1.statuses.listHistory(status.id)
|
||||
const paginator = useMastoClient().v1.statuses.$select(status.id).history.list()
|
||||
|
||||
function showHistory(edit: mastodon.v1.StatusEdit) {
|
||||
openEditHistoryDialog(edit)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue