import { NextResponse } from 'next/server'
import { createVideo, getAllVideo} from '@/methods/videoMethods'

export async function POST(request: Request) {
    const body = await request.json()
    const{idForm,titre,description} = body

    const result = await createVideo(idForm,titre,description)   
    return NextResponse.json(result, { status: 201 })
}

export async function GET(){
    const result = await getAllVideo()
    return NextResponse.json(result,{status : 200})
}

