-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
052 Dec 5: Iterating the Assessment Tracker and Compliance Tracker #330
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,5 +1,7 @@ | ||||||
import express from "express"; | ||||||
const router = express.Router(); | ||||||
const multer = require("multer"); | ||||||
const upload = multer({ Storage: multer.memoryStorage() }); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix the option name 'Storage' to 'storage' in multer configuration The configuration option for multer should be Apply this diff to fix the typo: -const upload = multer({ Storage: multer.memoryStorage() });
+const upload = multer({ storage: multer.memoryStorage() }); 📝 Committable suggestion
Suggested change
|
||||||
|
||||||
import { | ||||||
createAssessment, | ||||||
|
@@ -16,7 +18,7 @@ router.get("/", /*authenticateJWT, */ getAllAssessments); | |||||
router.get("/:id", /*authenticateJWT, */ getAssessmentById); | ||||||
|
||||||
// POST, PUT, DELETE requests | ||||||
router.post("/", /*authenticateJWT, */ createAssessment); | ||||||
router.post("/", /*authenticateJWT, */ upload.any("files"), createAssessment); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adjust multer middleware usage: The Apply this diff to use the correct multer middleware method: -router.post("/", /*authenticateJWT, */ upload.any("files"), createAssessment);
+router.post("/", /*authenticateJWT, */ upload.array("files"), createAssessment); 📝 Committable suggestion
Suggested change
|
||||||
router.put("/:id", /*authenticateJWT, */ updateAssessmentById); | ||||||
router.delete("/:id", /*authenticateJWT, */ deleteAssessmentById); | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return an appropriate error status code instead of 204 when creation fails
Returning a 204 No Content status when the assessment creation fails may be misleading. A 400 (Bad Request) or 500 (Internal Server Error) status code would better indicate that the operation did not succeed.
Apply this diff to return a more suitable error status code:
📝 Committable suggestion