console.log und noten In Deutsch un Mathe als Nummer pruefen
This commit is contained in:
@@ -5,8 +5,6 @@ import { json } from '@sveltejs/kit';
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
console.log(prisma.anmeldung.create);
|
||||
|
||||
export async function POST({ request }) {
|
||||
const formData = await request.formData();
|
||||
|
||||
@@ -15,6 +13,12 @@ export async function POST({ request }) {
|
||||
const pdfs = formData.getAll('pdfs') as File[];
|
||||
|
||||
const gespeichertePfade: string[] = [];
|
||||
const noteDeutsch = Number(get('noteDeutsch'));
|
||||
const noteMathe = Number(get('noteMathe'));
|
||||
|
||||
if (isNaN(noteDeutsch) || isNaN(noteMathe)) {
|
||||
return json({ error: 'Bitte gib gültige Noten an.' }, { status: 400 });
|
||||
}
|
||||
|
||||
for (const pdf of pdfs) {
|
||||
if (pdf.size > 0 && pdf.type === 'application/pdf') {
|
||||
@@ -24,6 +28,14 @@ export async function POST({ request }) {
|
||||
await writeFile(`static${pfad}`, buffer);
|
||||
gespeichertePfade.push(pfad);
|
||||
}
|
||||
|
||||
console.log({
|
||||
noteDeutsch: get('noteDeutsch'),
|
||||
noteMathe: get('noteMathe'),
|
||||
parsedDeutsch: parseFloat(get('noteDeutsch')),
|
||||
parsedMathe: parseFloat(get('noteMathe')),
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -39,8 +51,8 @@ export async function POST({ request }) {
|
||||
plz: get('plz'),
|
||||
telefon: get('telefon'),
|
||||
email: get('email'),
|
||||
noteDeutsch: parseFloat(get('noteDeutsch')),
|
||||
noteMathe: parseFloat(get('noteMathe')),
|
||||
noteDeutsch,
|
||||
noteMathe,
|
||||
sozialverhalten: get('sozialverhalten'),
|
||||
praktikumId: Number(formData.get('praktikumId')),
|
||||
schulart: get('schulart'),
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user