Add ToursTable, update API documentation

This commit is contained in:
2024-09-26 14:40:41 +02:00
parent 787c5a61e5
commit f5204578e4
46 changed files with 776 additions and 829 deletions

View File

@@ -0,0 +1,44 @@
import { Show } from "../models/acts/show.model";
import { Band } from "../models/acts/band.model";
import { Tour } from "../models/acts/tour.model";
import { Request, Response, Router } from "express";
import { Location } from "../models/acts/location.model";
import { Genre } from "../models/acts/genre.model";
import { City } from "../models/acts/city.model";
export const tour = Router()
tour.get("/", (req: Request, res: Response) => {
Tour.findAll({
include: [
{
model: Band,
include: [ Genre ],
attributes: {
exclude: [ "genreId" ]
}
},
{
model: Show,
include: [
{
model: Location,
include: [ City ],
attributes: {
exclude: [ "cityId" ]
}
}
],
attributes: {
exclude: [ "locationId", "tourId" ]
}
},
],
attributes: {
exclude: [ "bandId" ]
}
})
.then(tours => {
res.status(200).json(tours)
})
})