Creating Band edit page

This commit is contained in:
2024-10-26 14:35:33 +02:00
parent fedb821a72
commit cdb3f02156
16 changed files with 377 additions and 41 deletions

View File

@@ -133,4 +133,26 @@ band.get("/search", (req: Request, res: Response) => {
.then(bands => {
res.status(200).json(bands)
})
})
// Edit band
band.patch("/", (req: Request, res: Response) => {
Band.update(req.body, {
where: {
id: req.body.id
}
})
.then(result => {
res.status(200).json(result)
})
})
// New band
band.post("/", (req: Request, res: Response) => {
Band.create(req.body)
.then(result => {
res.status(200).json(result)
})
})