Can create inbox entries

This commit is contained in:
2025-05-10 18:37:51 +02:00
parent cceed381bd
commit 0b586039c3
8 changed files with 240 additions and 32 deletions

View File

@ -0,0 +1,46 @@
import { APIClient } from "./ApiClient";
export interface InboxEntry {
id: number;
file_id: number;
user_id: number;
movement_id?: number;
time: number;
label?: string;
amount?: number;
time_create: number;
time_update: number;
}
export interface InboxEntryUpdate {
file_id: number;
movement_id?: number;
time: number;
label?: string;
amount?: number;
}
export class InboxApi {
/**
* Create a new inbox entry
*/
static async Create(entry: InboxEntryUpdate): Promise<void> {
await APIClient.exec({
uri: `/inbox`,
method: "POST",
jsonData: entry,
});
}
/**
* Get the list of inbox entries
*/
static async GetList(includeAttached: boolean): Promise<InboxEntry[]> {
return (
await APIClient.exec({
uri: `/inbox?include_attached=${includeAttached ? "true" : "false"}`,
method: "GET",
})
).data;
}
}

View File

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