pages/orders and pages/clients: add missing logic in handleSubmit
All checks were successful
Build dev / build (push) Successful in 1m16s

in clients, adding 1 to total was missing
in orders, adding the added memeber to the list and adding to total was missing
This commit is contained in:
Wroclaw 2023-12-19 02:34:45 +01:00
parent ed739e27fd
commit a74e148da4
3 changed files with 10 additions and 0 deletions

View file

@ -98,6 +98,7 @@ async function handleSubmit() {
},
);
clients.value.unshift(result);
count.value.count++;
} catch (e) {
console.error(e);
submitting.value = false;

View file

@ -93,6 +93,14 @@ async function handleSubmit() {
body: formData.value,
},
);
orders.value.unshift({
...result,
imported_products_count: result.imported_products.length,
work_count: result.work.length,
// NOTE: currently all newly created orders on this page are valued zero
value: 0,
});
count.value.count++;
} catch (e) {
console.error(e);
submitting.value = false;

View file

@ -25,6 +25,7 @@ export async function getOrder(id: bigint) {
offer: true,
},
},
client: true,
},
});