Display concerts with card views on "All concerts" page, adding image property for tours

This commit is contained in:
2024-09-28 21:18:25 +02:00
parent 8d0b141217
commit 0616409f14
49 changed files with 454 additions and 219 deletions

View File

@@ -1,13 +1,13 @@
import { Location } from "../models/acts/location.model";
import { Show } from "../models/acts/show.model";
import { Concert } from "../models/acts/concert.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()
export const concert = Router()
show.get("/:id", (req: Request, res: Response) => {
Show.findByPk(req.params.id, {
concert.get("/:id", (req: Request, res: Response) => {
Concert.findByPk(req.params.id, {
include: [
Tour,
{

View File

@@ -1,6 +1,6 @@
import { Router, Request, Response } from "express";
import { Order } from "../models/ordering/order.model";
import { Show } from "../models/acts/show.model";
import { Concert } from "../models/acts/concert.model";
import { OrderItem } from "../models/ordering/orderItem.model";
import { Payment } from "../models/user/payment.model";
import { Address } from "../models/user/address.model";
@@ -18,7 +18,7 @@ order.get("/:id", (req: Request, res: Response) => {
model: OrderItem,
include: [
{
model: Show,
model: Concert,
include: [ Band, Location ],
attributes: {
exclude: [
@@ -50,7 +50,7 @@ order.post("/", (req: Request, res: Response) => {
productId: orderItem.productId
})
Show.decrement(
Concert.decrement(
"inStock",
{
by: orderItem.quantity,

View File

@@ -1,4 +1,4 @@
import { Show } from "../models/acts/show.model";
import { Concert } from "../models/acts/concert.model";
import { Band } from "../models/acts/band.model";
import { Tour } from "../models/acts/tour.model";
import { Request, Response, Router } from "express";
@@ -19,7 +19,7 @@ tour.get("/", (req: Request, res: Response) => {
}
},
{
model: Show,
model: Concert,
include: [
{
model: Location,