diff options
| author | おさむのひと <46447427+samunohito@users.noreply.github.com> | 2024-01-04 18:32:46 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-04 18:32:46 +0900 |
| commit | fa9c4a19b98167c7552bec8f4d791bd89db8fbbe (patch) | |
| tree | b889429cd20a5160de818ee61c2dcd9066e2c14b /packages/frontend/src/components/MkFollowButton.vue | |
| parent | refactor(frontend): reduce type errors (diff) | |
| download | sharkey-fa9c4a19b98167c7552bec8f4d791bd89db8fbbe.tar.gz sharkey-fa9c4a19b98167c7552bec8f4d791bd89db8fbbe.tar.bz2 sharkey-fa9c4a19b98167c7552bec8f4d791bd89db8fbbe.zip | |
refactor(frontend): os.tsに引き込んだscripts/api.tsの再exportをやめる (#12694)
* refactor(frontend): os.tsに引き込んだscripts/api.tsの再exportをやめる
* fix
* fix
* renate to "misskeyApi"
* rename file
Diffstat (limited to 'packages/frontend/src/components/MkFollowButton.vue')
| -rw-r--r-- | packages/frontend/src/components/MkFollowButton.vue | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/packages/frontend/src/components/MkFollowButton.vue b/packages/frontend/src/components/MkFollowButton.vue index eb5c54de6b..78c4fb3cd2 100644 --- a/packages/frontend/src/components/MkFollowButton.vue +++ b/packages/frontend/src/components/MkFollowButton.vue @@ -38,11 +38,12 @@ SPDX-License-Identifier: AGPL-3.0-only import { onBeforeUnmount, onMounted, ref } from 'vue'; import * as Misskey from 'misskey-js'; import * as os from '@/os.js'; +import { misskeyApi } from '@/scripts/misskey-api.js'; import { useStream } from '@/stream.js'; import { i18n } from '@/i18n.js'; import { claimAchievement } from '@/scripts/achievements.js'; import { $i } from '@/account.js'; -import { defaultStore } from "@/store.js"; +import { defaultStore } from '@/store.js'; const props = withDefaults(defineProps<{ user: Misskey.entities.UserDetailed, @@ -63,7 +64,7 @@ const wait = ref(false); const connection = useStream().useChannel('main'); if (props.user.isFollowing == null) { - os.api('users/show', { + misskeyApi('users/show', { userId: props.user.id, }) .then(onFollowChange); @@ -88,17 +89,17 @@ async function onClick() { if (canceled) return; - await os.api('following/delete', { + await misskeyApi('following/delete', { userId: props.user.id, }); } else { if (hasPendingFollowRequestFromYou.value) { - await os.api('following/requests/cancel', { + await misskeyApi('following/requests/cancel', { userId: props.user.id, }); hasPendingFollowRequestFromYou.value = false; } else { - await os.api('following/create', { + await misskeyApi('following/create', { userId: props.user.id, withReplies: defaultStore.state.defaultWithReplies, }); |