Skip to content

Commit 91a075f

Browse files
Add previous fixes to repository
1 parent bd3754e commit 91a075f

File tree

6 files changed

+7
-13
lines changed

6 files changed

+7
-13
lines changed

backend/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ const server = require('http').createServer(app)
2323

2424
app.listen(3100, () => {
2525
logger.info('Grappa app listening on port 3100!')
26-
logger.info('Debugging version: 0.0.5')
2726
logger.info(`Environment is ${process.env.NODE_ENV}`)
2827
})
2928

backend/package.json

100755100644
File mode changed.

backend/src/middleware/attachments.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,11 @@ const storage = () => {
1818
}
1919
}
2020

21-
const upload = () => {
22-
console.log("Starting upload")
23-
try {
24-
multer({ storage: storage() }).fields([
21+
const upload = multer({ storage: storage() }).fields([
2522
{ name: 'otherFile' },
2623
{ name: 'reviewFile', maxCount: 1 },
2724
{ name: 'thesisFile', maxCount: 1 }
2825
])
29-
} catch (e) {
30-
console.log("Upload failed. Error: ")
31-
console.log(e)
32-
throw e
33-
}
34-
}
26+
3527

3628
module.exports = upload

backend/src/middleware/auditLogger.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const loggedMethods = ['POST', 'PUT', 'DELETE']
55

66
module.exports = function auditLogger(req, res, next) {
77
console.log("Req: " + req.method + " " + req.originalUrl + " at " + new Date().toString())
8-
if (req.body) console.log("body keys: " + Object.keys(req.body))
8+
if (req.headers && req.headers.uid) console.log("Uid: " + req.headers.uid)
99
if (loggedMethods.includes(req.method)) {
1010
const type = `${req.method} ${req.originalUrl}`
1111

backend/src/routes/theses.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ router.put('/', jsonParser, auth.checkStaff, (req, res, next) => thesisControlle
7474
* @apiSuccess thesis New thesis
7575
* @apiSuccess roles New roles
7676
*/
77-
router.post('/', attachment, auth.checkStaff, (req, res, next) => thesisController.saveThesisForm(req, res).catch(next))
77+
router.post('/', attachment, auth.checkStaff, (req, res, next) => {
78+
console.log("Starting route post thesis :")
79+
return thesisController.saveThesisForm(req, res).catch(next)
80+
})
7881

7982
/**
8083
* @api {put} theses/printed Mark theses as printed

backend/src/util/ethesis.js

100755100644
File mode changed.

0 commit comments

Comments
 (0)