From fa9c4a19b98167c7552bec8f4d791bd89db8fbbe Mon Sep 17 00:00:00 2001 From: おさむのひと <46447427+samunohito@users.noreply.github.com> Date: Thu, 4 Jan 2024 18:32:46 +0900 Subject: refactor(frontend): os.tsに引き込んだscripts/api.tsの再exportをやめる (#12694) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor(frontend): os.tsに引き込んだscripts/api.tsの再exportをやめる * fix * fix * renate to "misskeyApi" * rename file --- packages/frontend/src/pages/share.vue | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'packages/frontend/src/pages/share.vue') diff --git a/packages/frontend/src/pages/share.vue b/packages/frontend/src/pages/share.vue index cb5acf3afa..030cfbb905 100644 --- a/packages/frontend/src/pages/share.vue +++ b/packages/frontend/src/pages/share.vue @@ -37,6 +37,7 @@ import * as Misskey from 'misskey-js'; import MkButton from '@/components/MkButton.vue'; import MkPostForm from '@/components/MkPostForm.vue'; import * as os from '@/os.js'; +import { misskeyApi } from '@/scripts/misskey-api.js'; import { definePageMetadata } from '@/scripts/page-metadata.js'; import { postMessageToParentWindow } from '@/scripts/post-message.js'; import { i18n } from '@/i18n.js'; @@ -76,7 +77,7 @@ async function init() { ] // TypeScriptの指示通りに変換する .map(q => 'username' in q ? { username: q.username, host: q.host === null ? undefined : q.host } : q) - .map(q => os.api('users/show', q) + .map(q => misskeyApi('users/show', q) .then(user => { visibleUsers.value.push(user); }, () => { @@ -91,11 +92,11 @@ async function init() { const replyId = urlParams.get('replyId'); const replyUri = urlParams.get('replyUri'); if (replyId) { - reply.value = await os.api('notes/show', { + reply.value = await misskeyApi('notes/show', { noteId: replyId, }); } else if (replyUri) { - const obj = await os.api('ap/show', { + const obj = await misskeyApi('ap/show', { uri: replyUri, }); if (obj.type === 'Note') { @@ -108,11 +109,11 @@ async function init() { const renoteId = urlParams.get('renoteId'); const renoteUri = urlParams.get('renoteUri'); if (renoteId) { - renote.value = await os.api('notes/show', { + renote.value = await misskeyApi('notes/show', { noteId: renoteId, }); } else if (renoteUri) { - const obj = await os.api('ap/show', { + const obj = await misskeyApi('ap/show', { uri: renoteUri, }); if (obj.type === 'Note') { @@ -126,7 +127,7 @@ async function init() { if (fileIds) { await Promise.all( fileIds.split(',') - .map(fileId => os.api('drive/files/show', { fileId }) + .map(fileId => misskeyApi('drive/files/show', { fileId }) .then(file => { files.value.push(file); }, () => { -- cgit v1.2.3-freya