Update movement dialog is operational

This commit is contained in:
2025-05-14 18:39:25 +02:00
parent b2f8a66c12
commit 0d30a8135c
3 changed files with 50 additions and 12 deletions

View File

@ -39,12 +39,14 @@ export class MovementApi {
/**
* Create a new movement
*/
static async Create(q: MovementUpdate): Promise<void> {
await APIClient.exec({
uri: `/movement`,
method: "POST",
jsonData: q,
});
static async Create(q: MovementUpdate): Promise<Movement> {
return (
await APIClient.exec({
uri: `/movement`,
method: "POST",
jsonData: q,
})
).data;
}
/**
@ -97,7 +99,9 @@ export class MovementApi {
/**
* Update a movement information
*/
static async Update(movement: Movement): Promise<Movement> {
static async Update(
movement: MovementUpdate & { id: number }
): Promise<Movement> {
return (
await APIClient.exec({
uri: `/movement/${movement.id}`,