refactor(frontend): os.tsに引き込んだscripts/api.tsの再exportをやめる (#12694)

* refactor(frontend): os.tsに引き込んだscripts/api.tsの再exportをやめる

* fix

* fix

* renate to "misskeyApi"

* rename file
This commit is contained in:
おさむのひと
2024-01-04 18:32:46 +09:00
committed by GitHub
parent ea41cc6ec0
commit fa9c4a19b9
191 changed files with 581 additions and 468 deletions

View File

@@ -8,6 +8,7 @@ import { defineAsyncComponent } from 'vue';
import { i18n } from '@/i18n.js';
import copyToClipboard from '@/scripts/copy-to-clipboard.js';
import * as os from '@/os.js';
import { misskeyApi } from '@/scripts/misskey-api.js';
import { MenuItem } from '@/types/menu.js';
import { defaultStore } from '@/store.js';
@@ -18,7 +19,7 @@ function rename(file: Misskey.entities.DriveFile) {
default: file.name,
}).then(({ canceled, result: name }) => {
if (canceled) return;
os.api('drive/files/update', {
misskeyApi('drive/files/update', {
fileId: file.id,
name: name,
});
@@ -31,7 +32,7 @@ function describe(file: Misskey.entities.DriveFile) {
file: file,
}, {
done: caption => {
os.api('drive/files/update', {
misskeyApi('drive/files/update', {
fileId: file.id,
comment: caption.length === 0 ? null : caption,
});
@@ -40,7 +41,7 @@ function describe(file: Misskey.entities.DriveFile) {
}
function toggleSensitive(file: Misskey.entities.DriveFile) {
os.api('drive/files/update', {
misskeyApi('drive/files/update', {
fileId: file.id,
isSensitive: !file.isSensitive,
}).catch(err => {
@@ -69,7 +70,7 @@ async function deleteFile(file: Misskey.entities.DriveFile) {
});
if (canceled) return;
os.api('drive/files/delete', {
misskeyApi('drive/files/delete', {
fileId: file.id,
});
}