diff --git a/backend/question-service/src/routes/questionRoutes.ts b/backend/question-service/src/routes/questionRoutes.ts index 6a7d44421a..bc26a6f5fd 100644 --- a/backend/question-service/src/routes/questionRoutes.ts +++ b/backend/question-service/src/routes/questionRoutes.ts @@ -5,7 +5,8 @@ const router: Router = Router(); // Create a new question (POST) router.post("/", async (req: Request, res: Response) => { - const { questionId, title, description, categories, complexity, link } = req.body; + const { questionId, title, description, categories, complexity, link } = + req.body; try { const newQuestion = new Question({ @@ -52,9 +53,10 @@ router.put("/:id", async (req: Request, res: Response) => { const updatedQuestion = await Question.findOneAndUpdate( { questionId: req.params.id }, { title, description, categories, complexity }, - { new: true } + { new: true }, ); - if (!updatedQuestion) return res.status(404).json({ error: "Question not found" }); + if (!updatedQuestion) + return res.status(404).json({ error: "Question not found" }); res.json(updatedQuestion); } catch (err) { res.status(500).json({ error: (err as Error).message }); @@ -67,7 +69,8 @@ router.delete("/:id", async (req: Request, res: Response) => { const deletedQuestion = await Question.findOneAndDelete({ questionId: req.params.id, }); - if (!deletedQuestion) return res.status(404).json({ error: "Question not found" }); + if (!deletedQuestion) + return res.status(404).json({ error: "Question not found" }); res.json({ message: "Question deleted successfully" }); } catch (err) { res.status(500).json({ error: (err as Error).message }); diff --git a/backend/question-service/tsconfig.json b/backend/question-service/tsconfig.json index d12fa23d20..603ddcf4cb 100644 --- a/backend/question-service/tsconfig.json +++ b/backend/question-service/tsconfig.json @@ -11,7 +11,7 @@ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ /* Language and Environment */ - "target": "ES6", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + "target": "ES6" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ // "jsx": "preserve", /* Specify what JSX code is generated. */ // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ @@ -25,7 +25,7 @@ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ /* Modules */ - "module": "commonjs", /* Specify what module code is generated. */ + "module": "commonjs" /* Specify what module code is generated. */, // "rootDir": "./", /* Specify the root folder within your source files. */ // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ @@ -57,7 +57,7 @@ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ // "noEmit": true, /* Disable emitting files from a compilation. */ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ - "outDir": "./dist", /* Specify an output folder for all emitted files. */ + "outDir": "./dist" /* Specify an output folder for all emitted files. */, // "removeComments": true, /* Disable emitting comments. */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ @@ -77,12 +77,12 @@ // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, /* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */ + "strict": true /* Enable all strict type-checking options. */, // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ @@ -105,7 +105,7 @@ /* Completeness */ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ }, "include": ["src/**/*.ts"] } diff --git a/frontend/src/pages/Login/Login.tsx b/frontend/src/pages/Login/Login.tsx index d4c1196ed0..a8b9fac1ea 100644 --- a/frontend/src/pages/Login/Login.tsx +++ b/frontend/src/pages/Login/Login.tsx @@ -55,7 +55,7 @@ const Login = (): ReactElement => { if (email === "test@example.com" && password === "password") { setLoading(true); setTimeout(() => { - navigate("/"); + navigate("/"); }, 3000); } else { setLoginError("Invalid email or password.");