Can attach file to movement

This commit is contained in:
2025-04-28 21:08:25 +02:00
parent ee145dab4f
commit 211c81dd66
5 changed files with 164 additions and 1 deletions

View File

@ -0,0 +1,28 @@
import { APIClient } from "./ApiClient";
export interface UploadedFile {
id: number;
time_create: number;
mime_type: string;
sha512: string;
file_size: number;
file_name: string;
user_id: number;
}
export class FileApi {
/**
* Upload a new file
*/
static async UploadFile(file: File): Promise<UploadedFile> {
const fd = new FormData();
fd.append("file", file);
return (
await APIClient.exec({
method: "POST",
uri: "/file",
formData: fd,
})
).data;
}
}

View File

@ -19,6 +19,7 @@ export interface ServerConstraints {
token_max_inactivity: LenConstraint;
account_name: LenConstraint;
movement_label: LenConstraint;
file_allowed_types: string[];
}
export interface LenConstraint {