import type { RequestEvent, RequestHandler } from './$types'
import {json} from '@sveltejs/kit'
import exams from "$lib/data/qualify-exam.json"
export const GET: RequestHandler = async ({params}: RequestEvent) => {
    const id =  params.id+""
    //const exams = await getCompetitiveExams()
    const post = exams.find((q)=>{
        return q.id===id
    })
    if(!post)
        return json({message:`ไม่พบการสอบแข่งขัน ID= ${id}`},{status:404})
    return json(post)
}

