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

@@ -1,10 +1,27 @@
import { Show } from "../models/show.model";
import { Location } from "../models/acts/location.model";
import { Show } from "../models/acts/show.model";
import { Request, Response, Router } from "express";
import { Tour } from "../models/acts/tour.model";
import { City } from "../models/acts/city.model";
export const show = Router()
show.get("/", (req: Request, res: Response) => {
Show.findAll()
show.get("/:id", (req: Request, res: Response) => {
Show.findByPk(req.params.id, {
include: [
Tour,
{
model: Location,
include: [ City ],
attributes: {
exclude: [ "cityId" ]
}
}
],
attributes: {
exclude: [ "locationId", "tourId" ]
}
})
.then(shows => {
res.status(200).json(shows)
})