mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-21 17:26:29 -05:00
Fix linter errors in imageRouter
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
9e2f9e21e9
commit
0195f16d9a
1 changed files with 7 additions and 7 deletions
|
@ -4,7 +4,7 @@ const Router = require('express').Router
|
|||
const formidable = require('formidable')
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
const { v4: uuidv4 } = require('uuid');
|
||||
const { v4: uuidv4 } = require('uuid')
|
||||
const os = require('os')
|
||||
const rimraf = require('rimraf')
|
||||
const isSvg = require('is-svg')
|
||||
|
@ -73,8 +73,8 @@ imageRouter.post('/uploadimage', function (req, res) {
|
|||
keepExtensions: true,
|
||||
uploadDir: tmpDir,
|
||||
filename: function (filename, ext) {
|
||||
if (typeof ext !== "string") {
|
||||
ext = ".invalid"
|
||||
if (typeof ext !== 'string') {
|
||||
ext = '.invalid'
|
||||
}
|
||||
return uuidv4() + ext
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ imageRouter.post('/uploadimage', function (req, res) {
|
|||
rimraf(tmpDir)
|
||||
return errors.errorForbidden(res)
|
||||
} else if (!files.image || !files.image.filepath) {
|
||||
logger.error("Image upload error: Upload didn't contain file)")
|
||||
logger.error('Image upload error: Upload didn\'t contain file)')
|
||||
rimraf.sync(tmpDir)
|
||||
return errors.errorBadRequest(res)
|
||||
} else if (!(await checkUploadType(files.image.filepath))) {
|
||||
|
|
Loading…
Reference in a new issue