Fix linter errors in imageRouter
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
		
							parent
							
								
									9e2f9e21e9
								
							
						
					
					
						commit
						0195f16d9a
					
				@ -4,7 +4,7 @@ const Router = require('express').Router
 | 
				
			|||||||
const formidable = require('formidable')
 | 
					const formidable = require('formidable')
 | 
				
			||||||
const path = require('path')
 | 
					const path = require('path')
 | 
				
			||||||
const fs = require('fs')
 | 
					const fs = require('fs')
 | 
				
			||||||
const { v4: uuidv4 } = require('uuid');
 | 
					const { v4: uuidv4 } = require('uuid')
 | 
				
			||||||
const os = require('os')
 | 
					const os = require('os')
 | 
				
			||||||
const rimraf = require('rimraf')
 | 
					const rimraf = require('rimraf')
 | 
				
			||||||
const isSvg = require('is-svg')
 | 
					const isSvg = require('is-svg')
 | 
				
			||||||
@ -73,8 +73,8 @@ imageRouter.post('/uploadimage', function (req, res) {
 | 
				
			|||||||
    keepExtensions: true,
 | 
					    keepExtensions: true,
 | 
				
			||||||
    uploadDir: tmpDir,
 | 
					    uploadDir: tmpDir,
 | 
				
			||||||
    filename: function (filename, ext) {
 | 
					    filename: function (filename, ext) {
 | 
				
			||||||
        if (typeof ext !== "string") {
 | 
					      if (typeof ext !== 'string') {
 | 
				
			||||||
            ext = ".invalid"
 | 
					        ext = '.invalid'
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      return uuidv4() + ext
 | 
					      return uuidv4() + ext
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -86,7 +86,7 @@ imageRouter.post('/uploadimage', function (req, res) {
 | 
				
			|||||||
      rimraf(tmpDir)
 | 
					      rimraf(tmpDir)
 | 
				
			||||||
      return errors.errorForbidden(res)
 | 
					      return errors.errorForbidden(res)
 | 
				
			||||||
    } else if (!files.image || !files.image.filepath) {
 | 
					    } 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)
 | 
					      rimraf.sync(tmpDir)
 | 
				
			||||||
      return errors.errorBadRequest(res)
 | 
					      return errors.errorBadRequest(res)
 | 
				
			||||||
    } else if (!(await checkUploadType(files.image.filepath))) {
 | 
					    } else if (!(await checkUploadType(files.image.filepath))) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user