From 2a12c9a51ecdcbdd8064846669a5b85126a9c624 Mon Sep 17 00:00:00 2001 From: Harsh V Srivastava Date: Thu, 26 Sep 2024 14:56:37 +0530 Subject: [PATCH] Remove started code from schema --- prisma/schema.prisma | 1 - src/routers/teacherAuth.route.ts | 2 +- src/utils/validation.ts | 9 --------- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/prisma/schema.prisma b/prisma/schema.prisma index f4ae19d..4af33f0 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -92,7 +92,6 @@ model Problem { id String @id @default(cuid()) title String description String - starterCode String examples Example[] testCases TestCase[] difficulty ProblemDifficulty @default(EASY) diff --git a/src/routers/teacherAuth.route.ts b/src/routers/teacherAuth.route.ts index 446938c..8aecb04 100644 --- a/src/routers/teacherAuth.route.ts +++ b/src/routers/teacherAuth.route.ts @@ -8,7 +8,7 @@ import { const teacherAuthRouter = Router(); teacherAuthRouter.post("/signup", validateTeacherSignup, async (req, res) => { - const { name, email, password, subjectCode } = req.body; + const { name, email, password } = req.body; const teacher = await prisma.teacher.create({ data: { name, diff --git a/src/utils/validation.ts b/src/utils/validation.ts index 7dd19fa..1b93e8d 100644 --- a/src/utils/validation.ts +++ b/src/utils/validation.ts @@ -54,15 +54,6 @@ export const validateTeacherSignup = [ } next(); }, - (req, res, next) => { - const { subjectCode } = req.body; - if (!Object.values(SubjectCode).includes(subjectCode)) { - return res - .status(400) - .json({ errors: [{ msg: "Invalid subject code" }] }); - } - next(); - }, ]; export const validateTeacherSignin = [