Use environtment variable to config API URL
This commit is contained in:
parent
b803beca10
commit
e3c74bb25e
13 changed files with 51 additions and 27 deletions
|
|
@ -1,11 +1,11 @@
|
|||
import {qualifyingBase} from '$lib/data/CMSDataType'
|
||||
import { env } from '$env/dynamic/private'
|
||||
import type {Exam} from '$lib/data/CMSDataType'
|
||||
import { error } from '@sveltejs/kit'
|
||||
import dayjs from 'dayjs'
|
||||
import type { PageServerLoad } from './$types'
|
||||
export const load: PageServerLoad = async ({params,fetch}) => {
|
||||
const id = params.id+""
|
||||
const res = await fetch(qualifyingBase+"/qualifying/"+id)
|
||||
const res = await fetch(env.API_QUALIFYING_URL+"/qualifying/"+id)
|
||||
if(res.status==404){
|
||||
throw error(404,{message:`ค้นหาข้อมูลสอบคัดเลือก ${id}ไม่พบ`})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue