import { NextResponse } from 'next/server'
import { createAchat,getAllAchat } from '@/methods/achatMethods'


export async function POST(request: Request) {
    const body = await request.json()
    const{idUtilisateur,idFormation} = body

    const result = await createAchat(idUtilisateur,idFormation)   
    return NextResponse.json(result, { status: 201 })
}

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