Can create inbox entries
This commit is contained in:
46
moneymgr_web/src/api/InboxApi.ts
Normal file
46
moneymgr_web/src/api/InboxApi.ts
Normal 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;
|
||||
}
|
||||
}
|
@ -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[];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user