Begin submission endpoint

This commit is contained in:
orosmatthew 2023-04-28 10:30:46 -04:00
parent c2ddf8bbd5
commit 86cfb4eb46
2 changed files with 25 additions and 0 deletions

View File

@ -12,3 +12,15 @@ model User {
username String @unique
password String
}
enum SubmissionState {
InReview
Correct
Incorrect
}
model Submission {
id Int @id @default(autoincrement())
state SubmissionState
message String?
}

View File

@ -0,0 +1,13 @@
import { z } from 'zod';
import type { RequestHandler } from './$types';
import { json } from '@sveltejs/kit';
import { SubmissionState } from '@prisma/client';
const submissionPostData = z.object({
state: z.nativeEnum(SubmissionState)
});
export type SubmissionPostData = z.infer<typeof submissionPostData>;
export const POST = (async ({ request }) => {
return json({ success: true });
}) satisfies RequestHandler;