Skip to content

Commit

Permalink
[backend] Formatted code
Browse files Browse the repository at this point in the history
  • Loading branch information
MananGandhi1810 committed Oct 31, 2024
1 parent 9f694bd commit 211dc8c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
3 changes: 2 additions & 1 deletion backend/handlers/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ const aiHelperHandler = async (req, res) => {
if (!code) {
code = "";
}
if (!history) {``
if (!history) {
``;
history = "";
}
if (!prompt) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Editorial" ADD COLUMN "hidden" BOOLEAN NOT NULL DEFAULT false;
5 changes: 3 additions & 2 deletions backend/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ model User {
updatedAt DateTime @updatedAt
passwordUpdatedAt DateTime @default(now())
admin Boolean @default(false)
editorials Editorial[]
editorials Editorial[]
}

model Submission {
Expand All @@ -58,7 +58,7 @@ model ProblemStatement {
difficulty Difficulty
submissions Submission[]
testCase Testcase[]
editorials Editorial[]
editorials Editorial[]
}

model Testcase {
Expand All @@ -78,6 +78,7 @@ model Editorial {
problemStatementId String
user User @relation(fields: [userId], references: [id])
userId String
hidden Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
6 changes: 5 additions & 1 deletion backend/router/code.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { Router } from "express";
import { checkAuth } from "../middlewares/auth.js";
import { queueCodeHandler, checkExecutionHandler, aiHelperHandler } from "../handlers/code.js";
import {
queueCodeHandler,
checkExecutionHandler,
aiHelperHandler,
} from "../handlers/code.js";

var router = Router();

Expand Down
5 changes: 4 additions & 1 deletion backend/router/leaderboard.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { Router } from "express";
import { checkAuth } from "../middlewares/auth.js";
import { getLeaderboardHandler, getUserPointsHandler } from "../handlers/leaderboard.js";
import {
getLeaderboardHandler,
getUserPointsHandler,
} from "../handlers/leaderboard.js";

var router = Router();

Expand Down

0 comments on commit 211dc8c

Please sign in to comment.