Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,12 @@ export interface Application extends IBase {
attrs?: ApplicationAttrs;
}

export interface FileInfo {
export interface UploadFileInfo {
id: string;
post_url: string;
post_fields: [string, string][];
}

export interface DownloadFileInfo {
url: string;
}
4 changes: 2 additions & 2 deletions src/lib/download-file.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FileInfo } from '@/interface';
import { DownloadFileInfo } from '@/interface';

import { http } from './request';

Expand All @@ -8,7 +8,7 @@ export async function downloadFile(
originalName: string
) {
try {
const fileInfo: FileInfo = await http.get(
const fileInfo: DownloadFileInfo = await http.get(
`/namespaces/${namespaceId}/resources/${resourceId}/file`,
{ mute: true }
);
Expand Down
4 changes: 2 additions & 2 deletions src/lib/upload-files.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FileInfo, IResourceData } from '@/interface';
import { IResourceData, UploadFileInfo } from '@/interface';
import { http } from '@/lib/request';

export interface UploadProgress {
Expand All @@ -13,7 +13,7 @@ async function uploadFile(
parentId: string,
file: File
): Promise<IResourceData> {
let fileInfo: FileInfo;
let fileInfo: UploadFileInfo;
try {
fileInfo = await http.post(
`/namespaces/${namespaceId}/resources/files`,
Expand Down
Loading