From 075f16caac5236cb04c98ae7b3a989766d764bb3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 11 Jul 2017 17:04:57 +0200 Subject: Remove "function" in favor of () => {} --- server/controllers/api/videos/index.ts | 6 +++--- server/controllers/client.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'server/controllers') diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index e70a5319e..815881df3 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts @@ -49,11 +49,11 @@ const videosRouter = express.Router() // multer configuration const storage = multer.diskStorage({ - destination: function (req, file, cb) { + destination: (req, file, cb) => { cb(null, CONFIG.STORAGE.VIDEOS_DIR) }, - filename: function (req, file, cb) { + filename: (req, file, cb) => { let extension = '' if (file.mimetype === 'video/webm') extension = 'webm' else if (file.mimetype === 'video/mp4') extension = 'mp4' @@ -310,7 +310,7 @@ function updateVideo (req: express.Request, res: express.Response) { // Force fields we want to update // If the transaction is retried, sequelize will think the object has not changed // So it will skip the SQL request, even if the last one was ROLLBACKed! - Object.keys(videoFieldsSave).forEach(function (key) { + Object.keys(videoFieldsSave).forEach(key => { const value = videoFieldsSave[key] videoInstance.set(key, value) }) diff --git a/server/controllers/client.ts b/server/controllers/client.ts index ac722a578..d913f81b8 100644 --- a/server/controllers/client.ts +++ b/server/controllers/client.ts @@ -24,7 +24,7 @@ const indexPath = join(distPath, 'index.html') // Do not use a template engine for a so little thing clientsRouter.use('/videos/watch/:id', generateWatchHtmlPage) -clientsRouter.use('/videos/embed', function (req: express.Request, res: express.Response, next: express.NextFunction) { +clientsRouter.use('/videos/embed', (req: express.Request, res: express.Response, next: express.NextFunction) => { res.sendFile(embedPath) }) @@ -32,7 +32,7 @@ clientsRouter.use('/videos/embed', function (req: express.Request, res: express. clientsRouter.use('/client', express.static(distPath, { maxAge: STATIC_MAX_AGE })) // 404 for static files not found -clientsRouter.use('/client/*', function (req: express.Request, res: express.Response, next: express.NextFunction) { +clientsRouter.use('/client/*', (req: express.Request, res: express.Response, next: express.NextFunction) => { res.sendStatus(404) }) -- cgit v1.2.3