refactor: upgrade masto 5 (#867)

This commit is contained in:
三咲智子 Kevin Deng 2023-01-08 14:21:09 +08:00 committed by GitHub
parent 39034c5777
commit 5c8f75b9b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
108 changed files with 438 additions and 445 deletions

View file

@ -1,8 +1,8 @@
<script setup lang="ts">
import type { Status } from 'masto'
import type { mastodon } from 'masto'
const { status } = defineProps<{
status: Status
status: mastodon.v1.Status
}>()
const poll = reactive({ ...status.poll! })
@ -30,7 +30,7 @@ async function vote(e: Event) {
poll.votersCount = (poll.votersCount || 0) + 1
cacheStatus({ ...status, poll }, undefined, true)
await masto.poll.vote(poll.id, { choices })
await masto.v1.polls.vote(poll.id, { choices })
}
const votersCount = $computed(() => poll.votersCount ?? 0)