
import type { PageServerLoad } from './$types'
import { error } from '@sveltejs/kit'
import {getQualifyExams} from "$lib/data/info"
export const load: PageServerLoad = async ({params}) => {
    const id =  params.id+""
    const exams = await getQualifyExams()
    const post = exams.find((q)=>{
        return q.id===id
    })

    if(post)
        return post
    else
        throw error(404,{message:"ค้นหาโพสเกี่ยวกับการคัดเลือกไม่พบ"})
    
}

