Better validation on text fields, change AlertBanner to Snackbar

This commit is contained in:
tobias committed 2024-09-24 22:18:27 +02:00
1 parent 14da64ecbe
commit e00107ab6a
19 files changed
+357 -190

No files matched your search

+19 -1
View File
@@ -78,11 +78,29 @@ account.post("/", (req: Request, res: Response) => {
})
account.patch("/", (req: Request, res: Response) => {
console.log(req.body)
Account.update(req.body,
{
where: { id: req.body.id }
})
.then(account => {
.then(async account => {
for (let payment of req.body.payments) {
await Payment.update(payment,
{
where: { id: payment.id }
}
)
}
for (let address of req.body.addresses) {
await Address.update(address,
{
where: { id: address.id }
}
)
}
// Status: 200 OK
res.status(200).json(account)
})