Merge pull request #213 from davidmehren/refactor_backend_notes

First steps in refactoring the backend code
This commit is contained in:
Sheogorath 2019-11-20 20:07:35 +01:00 committed by GitHub
commit 689f5a0a95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 564 additions and 581 deletions

View file

@ -5,7 +5,7 @@ const formidable = require('formidable')
const config = require('../../config')
const logger = require('../../logger')
const response = require('../../response')
const errors = require('../../errors')
const imageRouter = module.exports = Router()
@ -22,7 +22,7 @@ imageRouter.post('/uploadimage', function (req, res) {
form.parse(req, function (err, fields, files) {
if (err || !files.image || !files.image.path) {
logger.error(`formidable error: ${err}`)
response.errorForbidden(res)
errors.errorForbidden(res)
} else {
logger.debug(`SERVER received uploadimage: ${JSON.stringify(files.image)}`)