Better validation on text fields, change AlertBanner to Snackbar

This commit is contained in:
2024-09-24 22:18:27 +02:00
parent 14da64ecbe
commit e00107ab6a
19 changed files with 357 additions and 190 deletions

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)
})