From 5d6952a8b119ba203838010d7ff52b77f3867606 Mon Sep 17 00:00:00 2001 From: JTrenerry Date: Thu, 2 May 2024 18:35:10 +1000 Subject: [PATCH] added response --- backend/routes/routes.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/routes/routes.ts b/backend/routes/routes.ts index d704797..63e0d4f 100644 --- a/backend/routes/routes.ts +++ b/backend/routes/routes.ts @@ -359,8 +359,9 @@ router.get('/evan', async (req: Request, res: Response) => { // The sketch route router.get('/sketch', async (req: Request, res: Response) => { - const b = await db.query1('SELECT * FROM courses') + const b = await db.query1('SELECT "examId" FROM exams WHERE "examId" = 1'); if (b.rows.length != 0) { + res.status(400).json('Data already exists!'); return } @@ -415,8 +416,6 @@ router.get('/sketch', async (req: Request, res: Response) => { (3, 9, 'TRUEEE!!!', TRUE, TRUE, 999, 0), (3, 10, 'ong', FALSE, TRUE, 9, 1), (3, 9, 'Fax what a goat', FALSE, FALSE, 80, 1); - - `); res.status(200).json(`THIS SHIT SKETCH ASF AND WAS LIV'S IDEA!!!`); });