From 5116e43291aa5d20fdc4bd46a603b39c41ba6c74 Mon Sep 17 00:00:00 2001 From: Oliver Braun Date: Fri, 27 Jun 2025 17:48:07 +0200 Subject: [PATCH] feat: cleaunp --- src/client.ts | 15 +++ .../api/plan/examsInSlotWithRooms/+server.js | 115 ------------------ .../nta/ntaWithRegsByTeacher/+page.server.js | 44 ------- .../nta/ntaWithRegsByTeacher/+page.svelte | 16 --- 4 files changed, 15 insertions(+), 175 deletions(-) create mode 100644 src/client.ts delete mode 100644 src/routes/api/plan/examsInSlotWithRooms/+server.js delete mode 100644 src/routes/nta/ntaWithRegsByTeacher/+page.server.js delete mode 100644 src/routes/nta/ntaWithRegsByTeacher/+page.svelte diff --git a/src/client.ts b/src/client.ts new file mode 100644 index 0000000..04dda62 --- /dev/null +++ b/src/client.ts @@ -0,0 +1,15 @@ +import { HoudiniClient } from '$houdini'; + +export default new HoudiniClient({ + url: 'http://localhost:8080/query' + + // uncomment this to configure the network call (for things like authentication) + // for more information, please visit here: https://www.houdinigraphql.com/guides/authentication + // fetchParams({ session }) { + // return { + // headers: { + // Authorization: `Bearer ${session.token}`, + // } + // } + // } +}); diff --git a/src/routes/api/plan/examsInSlotWithRooms/+server.js b/src/routes/api/plan/examsInSlotWithRooms/+server.js deleted file mode 100644 index 0d31ec6..0000000 --- a/src/routes/api/plan/examsInSlotWithRooms/+server.js +++ /dev/null @@ -1,115 +0,0 @@ -import { env } from '$env/dynamic/private'; -import { json } from '@sveltejs/kit'; -import { request as gqlrequest, gql } from 'graphql-request'; - -/** @type {import('./$types').RequestHandler} */ -export async function POST({ request }) { - const query = gql` - query ($day: Int!, $time: Int!) { - examsInSlotWithRooms(day: $day, time: $time) { - exam { - exam { - ancode - zpaExam { - ancode - module - mainExamer - examType - groups - duration - } - primussExams { - ancode - module - mainExamer - program - examType - } - studentRegs { - program - studentRegs { - mtknr - ancode - program - presence - group - name - } - } - conflicts { - program - conflicts { - ancode - numberOfStuds - } - } - connectErrors - } - constraints { - ancode - notPlannedByMe - excludeDays - roomConstraints { - placesWithSocket - exahm - seb - lab - } - } - nta { - nta { - name - mtknr - compensation - deltaDurationPercent - needsRoomAlone - program - from - until - lastSemester - } - regs { - student { - name - mtknr - } - ancodes - } - } - slot { - dayNumber - slotNumber - starttime - } - } - rooms { - room { - name - seats - exahm - lab - handicap - } - seatsPlanned - handicap - students { - name - } - duration - reserve - } - } - } - `; - - const { day, time } = await request.json(); - - const variables = { - day, - time - }; - - const data = await gqlrequest(env.PLEXAMS_SERVER, query, variables); - - return json(data); -} diff --git a/src/routes/nta/ntaWithRegsByTeacher/+page.server.js b/src/routes/nta/ntaWithRegsByTeacher/+page.server.js deleted file mode 100644 index c3fde8d..0000000 --- a/src/routes/nta/ntaWithRegsByTeacher/+page.server.js +++ /dev/null @@ -1,44 +0,0 @@ -import { env } from '$env/dynamic/private'; -import { request, gql } from 'graphql-request'; - -export async function load({ params }) { - const query = gql` - query { - ntasWithRegsByTeacher { - teacher { - fullname - shortname - } - exams { - exam { - ancode - module - mainExamer - examType - groups - examTypeFull - zpaID - } - - ntas { - nta { - mtknr - name - compensation - needsRoomAlone - } - regs { - ancodes - } - } - } - } - } - `; - - let data = await request(env.PLEXAMS_SERVER, query); - - return { - ntasWithRegsByTeacher: data.ntasWithRegsByTeacher - }; -} diff --git a/src/routes/nta/ntaWithRegsByTeacher/+page.svelte b/src/routes/nta/ntaWithRegsByTeacher/+page.svelte deleted file mode 100644 index 03271bb..0000000 --- a/src/routes/nta/ntaWithRegsByTeacher/+page.svelte +++ /dev/null @@ -1,16 +0,0 @@ - - -
-
- {data.ntasWithRegsByTeacher.length} betroffene Prüfer:innen -
-
- -
- {#each data.ntasWithRegsByTeacher as teacherWithNTA} - - {/each} -