import { Request, Response } from "express";
import { PrismaClient } from "@prisma/client";

const prisma = new PrismaClient();

export const MovieController = {
    async list(req: Request, res: Response) {
        try{
            const movies = await prisma.movie.findMany();
            return res.status(200).json(movies);
        }
        catch(err){
            res.status(500).json({ error: err });
        }
    },
};