reservation.controller.js 613 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import axios from 'axios'
import { Reservation,Theater } from '../db/index.js'
import sequelize from 'sequelize'
const { Op } = sequelize

const findReservation = async (req,res) => {
    const {timetable} = req.body
    try {
        const reservedSeats = await Reservation.findAll({
            where: {
                timetable:timetable
            }
        })
        console.log(reservedSeats)
        res.json(reservedSeats)
    } catch (error) {
        return res.status(500).send(error.message || "이미 예매되어있는 좌석을 찾는 중 오류발생")
    }
}

export default {findReservation}