Upgrade package, Implement fake API, version info get from API. Waiting for real API

This commit is contained in:
schooltechx 2023-04-07 13:49:34 +07:00
parent faaae95956
commit 5b2d7ea68d
16 changed files with 853 additions and 615 deletions

View file

@ -1,9 +1,17 @@
import content from "$lib/data/content/qualifying.html?raw"
import {getQualifyExams} from "$lib/data/info"
import type { PageServerLoad } from './$types'
import type {CalendarEvent} from '$lib/components/CalendarEvent'
export const load: PageServerLoad = async () => {
const exams = await getQualifyExams()
import type {Exam} from '$lib/components/Exam'
export const load: PageServerLoad = async ({fetch}) => {
let content = ""
let exams:Exam[] = []
let res = await fetch("/api/content?page=qualifying")
if(res.ok){
content = (await res.json()).content
}
res = await fetch("/api/qualifying")
if(res.ok){
exams = await res.json()
}
const events:CalendarEvent[]=[]
exams.forEach(({id,title,start,institute_id})=>{
let backgroundColor =""