Merge commit
This commit is contained in:
commit
f2a70888e3
24 changed files with 989 additions and 654 deletions
4
.github/workflows/release.yaml
vendored
4
.github/workflows/release.yaml
vendored
|
|
@ -17,10 +17,10 @@ env:
|
|||
IMAGE_NAME: demo/qualifying-exam-cms
|
||||
DEPLOY_HOST: frappet.com
|
||||
COMPOSE_PATH: /home/frappet/docker/bma-ehr-qualifying-cms
|
||||
|
||||
|
||||
jobs:
|
||||
# act workflow_dispatch -W .github/workflows/release.yaml --input IMAGE_VER=v0.2.4-dev -s DOCKER_USER=sorawit -s DOCKER_PASS=P@ssword -s SSH_PASSWORD=P@ssw0rd
|
||||
# act --workflows .github/workflows/release.yaml --job release --input IMAGE_VER=v0.2.4-dev -s DOCKER_USER=sorawit -s DOCKER_PASS=P@ssword -s SSH_PASSWORD=P@ssw0rd
|
||||
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
|
|
|||
1303
cms/package-lock.json
generated
1303
cms/package-lock.json
generated
File diff suppressed because it is too large
Load diff
11
cms/src/lib/components/Exam.ts
Normal file
11
cms/src/lib/components/Exam.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
export interface Exam {
|
||||
id:string;
|
||||
title:string;
|
||||
start?:Date|string;
|
||||
end?:Date|string;
|
||||
exam_date?:Date|string;
|
||||
announcement_date?:Date|string;
|
||||
category_id?:string
|
||||
category?:string
|
||||
img?:string;
|
||||
}
|
||||
|
|
@ -6,6 +6,12 @@
|
|||
"detail":"<p><b>ประกาศรายชื่อผู้ผ่านภาค</b> ข. และมีสิทธิสอบภาค ค. ในการคัดเลือกคนพิการ ครั้งที่ 1/2565</p> <p> <img src='https://webportal.bangkok.go.th/public/user_files_editor/305/%E0%B8%9B%E0%B8%8F%E0%B8%B4%E0%B8%97%E0%B8%B4%E0%B8%99%E0%B8%A7%E0%B8%B1%E0%B8%99%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%84.%E0%B8%84%E0%B8%99%E0%B8%9E%E0%B8%B4%E0%B8%81%E0%B8%B2%E0%B8%A3.jpg'> </p>",
|
||||
"title":"ประกาศรายชื่อผู้ผ่านภาค ข. และมีสิทธิสอบภาค ค. ในการคัดเลือกคนพิการ ครั้งที่ 1/2565",
|
||||
"img":"/images/c1.jpg",
|
||||
"images":[
|
||||
{
|
||||
"title":"ภาพ1",
|
||||
"url":"https://bma-qualifying.frappet.synology.me/images/c1.jpg"
|
||||
}
|
||||
],
|
||||
"files":[
|
||||
{
|
||||
"title":"รายละเอียดประกาศ",
|
||||
|
|
@ -47,9 +53,7 @@
|
|||
"start":"2023-04-20T09:00:00",
|
||||
"detail":"ใครลืมส่งเอกสาร !! สำหรับการคัดเลือกคนพิการฯ ครั้งที่ 1/2565 ส่งเอกสารเพิ่มได้",
|
||||
"title":"ใครลืมส่งเอกสาร !! สำหรับการคัดเลือกคนพิการฯ ครั้งที่ 1/2565 ส่งเอกสารเพิ่มได้",
|
||||
"img":"/images/c2.jpg",
|
||||
"docUrl":"https://webportal.bangkok.go.th/public/user_files_editor/305/%E0%B8%9B%E0%B8%A3%E0%B8%B0%E0%B8%81%E0%B8%B2%E0%B8%A8%E0%B8%84%E0%B8%B1%E0%B8%94%E0%B9%80%E0%B8%A5%E0%B8%B7%E0%B8%AD%E0%B8%81%E0%B8%A5%E0%B8%B9%E0%B8%81%E0%B8%88%E0%B9%89%E0%B8%B2%E0%B8%87.pdf"
|
||||
|
||||
"img":"/images/c2.jpg"
|
||||
},
|
||||
{
|
||||
"id":"18",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<h1>เกี่ยวกับกองสรรหาบุคคล</h1>
|
||||
้<h3>(Recruitment Division)</h3>
|
||||
<h3>(Recruitment Division)</h3>
|
||||
|
||||
<p>
|
||||
มีหน้าที่รับผิดชอบเกี่ยวกับการสรรหาและเลือกสรร บุคคลเข้ารับราชการเป็นข้าราชการกรุงเทพมหานครสามัญ และข้าราชการครูกรุงเทพมหานครเฉพาะสังกัดสำนักพัฒนาชุมชน การดำเนินการเกี่ยวกับทุน จากแหล่งทุนภายนอกการดำเนินการเกี่ยวกับมาตรฐานคุณสมบัติบุคคและปฎิบัติหน้าที่อื่นที่เกี่ยวข้อง โดยแบ่งงานภายในส่วนราชการดังนี้
|
||||
|
|
@ -20,10 +20,9 @@
|
|||
ดำเนินการสอบและสรรหาบุคคลเข้ารับราชการเป็นข้าราชการกรุงเทพมหานครสามัญ รวมถึงดำเนินการสอบวัดควสามรู้ความสามารถเฉพาะตำแหน่ง
|
||||
จัดทำ และปรับปรุงหลักเกณท์วิธีการสอบและการคัดเลือก พิจจารณาการให้ทุนจากภัยนอกแก่ข้าราชการกรุงเทพมหานคร
|
||||
</p>
|
||||
ิ<br>
|
||||
<br>
|
||||
<h2>ฝ่ายบริหารงานทั่วไป</h2>
|
||||
<p>
|
||||
งานด้านสารบรรณ ธุรการทั่วไป การจัดประชุม ควบคุมดูแลสถานที่และยานพาหนะ การเงิน บัญชี งบประมาณบัญชี งบประมาณบัญชีและพัสดุ
|
||||
จัดทำรายงาน และประเมินผลแผนปฎิบัติราชการประจำปี
|
||||
|
||||
</p>
|
||||
|
|
|
|||
44
cms/src/lib/data/exam.json
Normal file
44
cms/src/lib/data/exam.json
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
"id":"21",
|
||||
"category":"สำนักงาน ก.ก.","category_id":1,
|
||||
"start":"2023-04-24",
|
||||
"title":"ด่วน !! ประกาศวัน เวลา สถานที่ และระเบียบการคัดเลือกลูกจ้างกทม.",
|
||||
"detail":"<p>สำนักงานคณะกรรมการข้าราชการกรุงเทพมหานคร ประกาศกำหนดวัน เวลา สถานที่คัดเลือก และระเบียบ เกี่ยวกับการคัดเลือกบุคลากรกรุงเทพมหานครหรือผู้ปฏิบัติงานอื่นในกรุงเทพมหานครเพื่อบรรจุและแต่งตั้ง เป็นข้าราชการกรุงเทพมหานครสามัญ ครั้งที่ 1 / 2565</p><p> <center> <br> <img src='https://webportal.bangkok.go.th/public/user_files_editor/305/bkkgovjob202303_12.jpg'></center></p>",
|
||||
"images":[
|
||||
{
|
||||
"title":"ภาพ1",
|
||||
"url":"https://bma-qualifying.frappet.synology.me/images/c1.jpg"
|
||||
},
|
||||
{
|
||||
"title":"ภาพ2",
|
||||
"url":"https://bma-qualifying.frappet.synology.me/images/c2.jpg"
|
||||
}
|
||||
],
|
||||
"files":[
|
||||
{
|
||||
"title":"รายละเอียดประกาศฯ คลิกที่นี่ !!",
|
||||
"url":"https://webportal.bangkok.go.th/public/user_files_editor/305/%E0%B8%9B%E0%B8%A3%E0%B8%B0%E0%B8%81%E0%B8%B2%E0%B8%A8%E0%B8%A7%E0%B8%B1%E0%B8%99%20%E0%B9%80%E0%B8%A7%E0%B8%A5%E0%B8%B2%20%E0%B8%AA%E0%B8%96%E0%B8%B2%E0%B8%99%E0%B8%97%E0%B8%B5%E0%B9%88%E0%B8%84%E0%B8%B1%E0%B8%94%E0%B9%80%E0%B8%A5%E0%B8%B7%E0%B8%AD%E0%B8%81%E0%B8%A5%E0%B8%B9%E0%B8%81%E0%B8%88%E0%B9%89%E0%B8%B2%E0%B8%87%E0%B8%AF.pdf"
|
||||
},
|
||||
{
|
||||
"title":"ค้นหาสถานที่คัดเลือก คลิกที่นี่ !!",
|
||||
"url":"https://bangkokgov.thaijobjob.com/bkkgovjob/searchApp.php?z=333"
|
||||
},
|
||||
{
|
||||
"title":"แผนที่ตั้งของสนามสอบ คลิกที่นี่ !!",
|
||||
"url":"https://file.thaijobjob.com/prakad/bkkgovjob202303/bkkgovjob202303_9"
|
||||
},
|
||||
{
|
||||
"title":"แผนผังสนามสอบ คลิกที่นี่ !!",
|
||||
"url":"https://file.thaijobjob.com/prakad/bkkgovjob202303/bkkgovjob202303_14"
|
||||
},
|
||||
{
|
||||
"title":"แผนผังสนามสอบ คลิกที่นี่ !!",
|
||||
"url":"https://file.thaijobjob.com/prakad/bkkgovjob202303/bkkgovjob202303_14"
|
||||
},
|
||||
{
|
||||
"title":"การแต่งกาย",
|
||||
"url":"https://webportal.bangkok.go.th/public/user_files_editor/305/bkkgovjob202303_12.jpg"
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
40
cms/src/lib/data/exams.json
Normal file
40
cms/src/lib/data/exams.json
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
[
|
||||
{
|
||||
"id":"21",
|
||||
"category":"สำนักงาน ก.ก.","category_id":1,
|
||||
"start":"2023-04-24",
|
||||
"title":"ด่วน !! ประกาศวัน เวลา สถานที่ และระเบียบการคัดเลือกลูกจ้างกทม.",
|
||||
"image":"https://bma-qualifying.frappet.synology.me//images/sel1.png"
|
||||
},
|
||||
{
|
||||
"id":"20",
|
||||
"category":"สำนักงาน ก.ก.","category_id":1,
|
||||
"start":"2023-04-03",
|
||||
"title":"วัน เวลา สถานที่ และระเบียบการคัดเลือกลูกจ้างกทม.",
|
||||
"image":"https://bma-qualifying.frappet.synology.me/images/sel2.png"
|
||||
},
|
||||
{
|
||||
"id":"19",
|
||||
"category":"สำนักการแพทย์","category_id":3,
|
||||
"start":"2003-12-20",
|
||||
"end":"2003-12-20",
|
||||
"exam_date":"2003-12-20T09:00:00",
|
||||
"announcement_date":"2003-12-20T09:00:00",
|
||||
"title":"ประกาศรับสมัครคัดเลือกบุคลากรกทม. !!",
|
||||
"image":"https://bma-qualifying.frappet.synology.me/images/sel3.png"
|
||||
},
|
||||
{
|
||||
"id":"18",
|
||||
"category":"สำนักอนามัย","category_id":2,
|
||||
"start":"2023-11-05T09:00:00",
|
||||
"title":"สอบครั้งที่ 1/2565",
|
||||
"image":"https://bma-qualifying.frappet.synology.me/images/sel1.png"
|
||||
},
|
||||
{
|
||||
"id":"17",
|
||||
"category":"สำนักงาน ก.ก.","category_id":1,
|
||||
"start":"2023-11-01",
|
||||
"title":"รับสมัครสอบตำแหน่งลูกจ้างและผู้ปฎิบัติงาน 1/2565",
|
||||
"image":"https://bma-qualifying.frappet.synology.me//images/sel2.png"
|
||||
}
|
||||
]
|
||||
|
|
@ -1,13 +1,42 @@
|
|||
{
|
||||
"contact":{
|
||||
"company_name": "กองสรรหาบุคคล",
|
||||
"description":
|
||||
"มีหน้าที่รับผิดชอบเกี่ยวกับการสรรหาและเลือกสรรบุคคลเข้ารับราบการเป็นข้าราขการกรุงเทพมหานคร สามัญและข้าราชการครูกรุงเทพมหานครเฉพาะสังกัดสำนักพัฒนาชุมชน ....",
|
||||
"contact_email_address": "sale@frappet.com",
|
||||
"phone": "(662) xxx xxx",
|
||||
"address": "123 Example Street, xxx, 9876, yyy",
|
||||
"zip": "10510",
|
||||
"Country": "Thailand"
|
||||
}
|
||||
|
||||
}
|
||||
"logo_url":"/images/logo.png",
|
||||
"organization": "กองสรรหาบุคคล",
|
||||
"supervised":"สำนักงาน ก.ก.",
|
||||
"address": "173 ถนนดินสอ แขวงเสาชิงช้า เขตพระนคร กรุงเทพมหานคร 10200",
|
||||
"divisions": [
|
||||
{
|
||||
"title":"กองสรรหาบุคคล",
|
||||
"url":"https://webportal.bangkok.go.th/KSB"
|
||||
},
|
||||
{
|
||||
"title":"กองพัฒนาระบบราชการ",
|
||||
"url":"https://webportal.bangkok.go.th/pdbma"
|
||||
},
|
||||
{
|
||||
"title":"กองอัตรากำลัง",
|
||||
"url":"https://webportal.bangkok.go.th/csc_personal"
|
||||
},
|
||||
{
|
||||
"title":"กองทะเบียนประวัติข้าราชการ",
|
||||
"url":"http://203.155.220.238/csc/index.php/en/discipline-morality"
|
||||
}
|
||||
],
|
||||
"institutes":[
|
||||
{
|
||||
"title":"กรุงเทพมหานคร",
|
||||
"url":"https://main.bangkok.go.th/"
|
||||
},
|
||||
{
|
||||
"title":"สนป.กทม./กองการเจ้าหน้าที่",
|
||||
"url":"https://webportal.bangkok.go.th/pdd"
|
||||
},
|
||||
{
|
||||
"title":"สำนักการศึกษา กทม.",
|
||||
"url":"https://webportal.bangkok.go.th/bangkokeducation"
|
||||
},
|
||||
{
|
||||
"title":"สำนักงาน ก.พ.",
|
||||
"url":"https://www.ocsc.go.th/"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
//TDD
|
||||
//TDD Implement unitest here
|
||||
import {it,expect } from 'vitest'
|
||||
import {getContact} from './info'
|
||||
it('test getContact() ',async ()=>{
|
||||
const result = await getContact()
|
||||
const result = {company_name:"กองสรรหาบุคคล",Country:"Thailand"}
|
||||
expect(result.company_name).toBe("กองสรรหาบุคคล")
|
||||
expect(result.Country).toBe("Thailand")
|
||||
})
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
|
||||
import qualify_exams from "./qualify-exam.json"
|
||||
export async function getQualifyExams(limit=0){
|
||||
if(qualify_exams.length>limit && limit>0)
|
||||
return qualify_exams.slice(0,limit)
|
||||
return qualify_exams
|
||||
}
|
||||
|
||||
|
||||
import competitive_exam from "./competitive-exam.json"
|
||||
export async function getCompetitiveExams(limit=0){
|
||||
if(competitive_exam.length>limit && limit>0)
|
||||
return competitive_exam.slice(0,limit)
|
||||
return competitive_exam
|
||||
}
|
||||
|
||||
|
|
@ -6,7 +6,6 @@
|
|||
"title":"ด่วน !! ประกาศวัน เวลา สถานที่ และระเบียบการคัดเลือกลูกจ้างกทม.",
|
||||
"detail":"<p><center><img src='https://webportal.bangkok.go.th/public/user_files_editor/305/bkkgovjob202303_12.jpg'></center></p><br/><center><h2>สำนักงานคณะกรรมการข้าราชการกรุงเทพมหานคร ประกาศกำหนดวัน เวลา สถานที่คัดเลือก และระเบียบ เกี่ยวกับการคัดเลือกบุคลากรกรุงเทพมหานครหรือผู้ปฏิบัติงานอื่นในกรุงเทพมหานครเพื่อบรรจุและแต่งตั้ง เป็นข้าราชการกรุงเทพมหานครสามัญ ครั้งที่ 1 / 2565</h2></center>",
|
||||
"img":"/images/sel1.png",
|
||||
"docUrl":"https://webportal.bangkok.go.th/public/user_files_editor/305/%E0%B8%9B%E0%B8%A3%E0%B8%B0%E0%B8%81%E0%B8%B2%E0%B8%A8%E0%B8%84%E0%B8%B1%E0%B8%94%E0%B9%80%E0%B8%A5%E0%B8%B7%E0%B8%AD%E0%B8%81%E0%B8%A5%E0%B8%B9%E0%B8%81%E0%B8%88%E0%B9%89%E0%B8%B2%E0%B8%87.pdf",
|
||||
"files":[
|
||||
{
|
||||
"title":"รายละเอียดประกาศฯ",
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
import exams from "./qualify-exam.json"
|
||||
export async function getExams(){
|
||||
return exams
|
||||
}
|
||||
|
|
@ -1,9 +1,22 @@
|
|||
import content from "$lib/data/content/home.html?raw"
|
||||
import { getQualifyExams,getCompetitiveExams } from '$lib/data/info';
|
||||
//import content from "$lib/data/content/home.html?raw"
|
||||
//import { getQualifyExams,getCompetitiveExams } from '$lib/data/info';
|
||||
import type { PageServerLoad } from './$types';
|
||||
|
||||
export const load: PageServerLoad = async () => {
|
||||
const qualify_exams = await getQualifyExams(3);
|
||||
const competitive_exams = await getCompetitiveExams(3);
|
||||
import type {Exam} from '$lib/components/Exam'
|
||||
export const load: PageServerLoad = async ({fetch}) => {
|
||||
let qualify_exams: Exam[] = []
|
||||
let competitive_exams: Exam[] = []
|
||||
let content = ""
|
||||
let res = await fetch("/api/content?page=home")
|
||||
if(res.ok){
|
||||
content = (await res.json()).content
|
||||
}
|
||||
res = await fetch("/api/qualifying")
|
||||
if(res.ok){
|
||||
qualify_exams = await res.json()
|
||||
}
|
||||
res = await fetch("/api/competitive")
|
||||
if(res.ok){
|
||||
competitive_exams = await res.json()
|
||||
}
|
||||
return { content , qualify_exams,competitive_exams };
|
||||
};
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
Recruitment Division
|
||||
</h2>
|
||||
<p class="mt-4 text-lg leading-relaxed text-blueGray-500">
|
||||
{data.content}
|
||||
{@html data.content}
|
||||
</p>
|
||||
<div class="mt-12">
|
||||
<a
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
<script lang="ts">
|
||||
|
||||
import ver from "$lib/ver.json"
|
||||
import type { PageData } from './$types'
|
||||
export let data: PageData;
|
||||
|
||||
</script>
|
||||
<section>
|
||||
<div class="p-one parallax-inner">
|
||||
|
|
@ -32,8 +29,6 @@
|
|||
<div>
|
||||
{@html data.content}
|
||||
</div>
|
||||
<div class="pt-12">{ver.version}</div>
|
||||
<div>{ver.builddate}</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
|||
6
cms/src/routes/api/competitive/+server.ts
Normal file
6
cms/src/routes/api/competitive/+server.ts
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import type {RequestHandler } from './$types'
|
||||
import {json} from '@sveltejs/kit'
|
||||
import exams from "$lib/data/competitive-exam.json"
|
||||
export const GET: RequestHandler = async () => {
|
||||
return json(exams)
|
||||
}
|
||||
14
cms/src/routes/api/competitive/[id]/+server.ts
Normal file
14
cms/src/routes/api/competitive/[id]/+server.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import type { RequestEvent, RequestHandler } from './$types'
|
||||
import {json} from '@sveltejs/kit'
|
||||
import exams from "$lib/data/competitive-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)
|
||||
}
|
||||
|
||||
31
cms/src/routes/api/content/+server.ts
Normal file
31
cms/src/routes/api/content/+server.ts
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import type { RequestEvent, RequestHandler } from './$types'
|
||||
import {json} from '@sveltejs/kit'
|
||||
import home_content from "$lib/data/content/home.html?raw"
|
||||
import about_content from "$lib/data/content/about.html?raw"
|
||||
import qualifying_content from "$lib/data/content/qualifying.html?raw"
|
||||
import competitive_content from "$lib/data/content/competitive.html?raw"
|
||||
export const GET: RequestHandler = async ({url}: RequestEvent) => {
|
||||
let content = ""
|
||||
const page= url.searchParams.get("page") ?? 'nopage'
|
||||
switch (page) {
|
||||
case "home":
|
||||
content = home_content
|
||||
break;
|
||||
case "qualifying":
|
||||
content = qualifying_content
|
||||
break;
|
||||
case "competitive":
|
||||
content = competitive_content
|
||||
break;
|
||||
case "about":
|
||||
content = about_content
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
//slience error just send empty content if not found
|
||||
if(!content)
|
||||
console.log(`Request content ${page} not found`)
|
||||
return json({content})
|
||||
|
||||
}
|
||||
8
cms/src/routes/api/info/+server.ts
Normal file
8
cms/src/routes/api/info/+server.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import ver from "$lib/ver.json"
|
||||
import {json} from '@sveltejs/kit'
|
||||
import type { RequestHandler } from './$types'
|
||||
export const GET: RequestHandler = async () => {
|
||||
const version = ver.version
|
||||
const builddate = ver.builddate
|
||||
return json({version,builddate})
|
||||
}
|
||||
6
cms/src/routes/api/qualifying/+server.ts
Normal file
6
cms/src/routes/api/qualifying/+server.ts
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import type { RequestHandler } from './$types'
|
||||
import {json} from '@sveltejs/kit'
|
||||
import exams from "$lib/data/qualify-exam.json"
|
||||
export const GET: RequestHandler = async () => {
|
||||
return json(exams)
|
||||
}
|
||||
14
cms/src/routes/api/qualifying/[id]/+server.ts
Normal file
14
cms/src/routes/api/qualifying/[id]/+server.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
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)
|
||||
}
|
||||
|
||||
|
|
@ -1,9 +1,20 @@
|
|||
import content from "$lib/data/content/competitive.html?raw"
|
||||
import {getCompetitiveExams} from "$lib/data/info"
|
||||
import type { PageServerLoad } from './$types'
|
||||
import type {CalendarEvent} from '$lib/components/CalendarEvent'
|
||||
export const load: PageServerLoad = async () => {
|
||||
const exams = await getCompetitiveExams()
|
||||
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=competitive")
|
||||
if(res.ok){
|
||||
content = (await res.json()).content
|
||||
}
|
||||
|
||||
res = await fetch("/api/competitive")
|
||||
if(res.ok){
|
||||
exams = await res.json()
|
||||
}
|
||||
|
||||
const events:CalendarEvent[]=[]
|
||||
exams.forEach(({id,title,start})=>{
|
||||
const backgroundColor ="rgb(153 153 255 / 34%)"
|
||||
|
|
|
|||
|
|
@ -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 =""
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"extends": "./.svelte-kit/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"ignoreDeprecations": "5.0",
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"esModuleInterop": true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue