Skip to content

Commit

Permalink
Add previous fixes to repository
Browse files Browse the repository at this point in the history
  • Loading branch information
ShootingStar91 committed Aug 28, 2023
1 parent bd3754e commit 91a075f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 13 deletions.
1 change: 0 additions & 1 deletion backend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const server = require('http').createServer(app)

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

Expand Down
Empty file modified backend/package.json
100755 → 100644
Empty file.
12 changes: 2 additions & 10 deletions backend/src/middleware/attachments.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,11 @@ const storage = () => {
}
}

const upload = () => {
console.log("Starting upload")
try {
multer({ storage: storage() }).fields([
const upload = multer({ storage: storage() }).fields([
{ name: 'otherFile' },
{ name: 'reviewFile', maxCount: 1 },
{ name: 'thesisFile', maxCount: 1 }
])
} catch (e) {
console.log("Upload failed. Error: ")
console.log(e)
throw e
}
}


module.exports = upload
2 changes: 1 addition & 1 deletion backend/src/middleware/auditLogger.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const loggedMethods = ['POST', 'PUT', 'DELETE']

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

Expand Down
5 changes: 4 additions & 1 deletion backend/src/routes/theses.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ router.put('/', jsonParser, auth.checkStaff, (req, res, next) => thesisControlle
* @apiSuccess thesis New thesis
* @apiSuccess roles New roles
*/
router.post('/', attachment, auth.checkStaff, (req, res, next) => thesisController.saveThesisForm(req, res).catch(next))
router.post('/', attachment, auth.checkStaff, (req, res, next) => {
console.log("Starting route post thesis :")
return thesisController.saveThesisForm(req, res).catch(next)
})

/**
* @api {put} theses/printed Mark theses as printed
Expand Down
Empty file modified backend/src/util/ethesis.js
100755 → 100644
Empty file.

0 comments on commit 91a075f

Please sign in to comment.