Enhance search for band names of concerts

This commit is contained in:
2024-10-22 19:16:30 +02:00
parent 4b43757dd4
commit cf9a888a97
6 changed files with 28 additions and 17 deletions

View File

@@ -102,9 +102,18 @@ concert.get("/concert/:id", (req: Request, res: Response) => {
concert.get("/search", (req: Request, res: Response) => {
Concert.findAll({
where: {
name: {
[Op.substring]: req.query.value
}
[Op.or]: [
{
name: {
[Op.substring]: req.query.value
}
},
{
"$band.name$": {
[Op.substring]: req.query.value
}
}
]
},
include: [ Band, Location ]
})