pages/orders and pages/clients: add missing logic in handleSubmit
All checks were successful
Build dev / build (push) Successful in 1m16s
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:
parent
ed739e27fd
commit
a74e148da4
3 changed files with 10 additions and 0 deletions
|
@ -98,6 +98,7 @@ async function handleSubmit() {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
clients.value.unshift(result);
|
clients.value.unshift(result);
|
||||||
|
count.value.count++;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
submitting.value = false;
|
submitting.value = false;
|
||||||
|
|
|
@ -93,6 +93,14 @@ async function handleSubmit() {
|
||||||
body: formData.value,
|
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) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
submitting.value = false;
|
submitting.value = false;
|
||||||
|
|
|
@ -25,6 +25,7 @@ export async function getOrder(id: bigint) {
|
||||||
offer: true,
|
offer: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
client: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue