Begin submission endpoint
This commit is contained in:
parent
c2ddf8bbd5
commit
86cfb4eb46
@ -12,3 +12,15 @@ model User {
|
|||||||
username String @unique
|
username String @unique
|
||||||
password String
|
password String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum SubmissionState {
|
||||||
|
InReview
|
||||||
|
Correct
|
||||||
|
Incorrect
|
||||||
|
}
|
||||||
|
|
||||||
|
model Submission {
|
||||||
|
id Int @id @default(autoincrement())
|
||||||
|
state SubmissionState
|
||||||
|
message String?
|
||||||
|
}
|
||||||
|
13
web/src/routes/api/submission/+server.ts
Normal file
13
web/src/routes/api/submission/+server.ts
Normal 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;
|
Loading…
Reference in New Issue
Block a user