From 94e39d74bffa38ad08ac6b248dd1bbedfb9e71a1 Mon Sep 17 00:00:00 2001 From: Jori Lallo Date: Sun, 14 Aug 2016 12:04:47 +0200 Subject: [PATCH] lint --- server/api/user.js | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/server/api/user.js b/server/api/user.js index 659d176e..fc19ca6c 100644 --- a/server/api/user.js +++ b/server/api/user.js @@ -7,7 +7,6 @@ import { } from '../utils/s3'; import auth from './authentication'; import { presentUser } from '../presenters'; -import { User } from '../models'; const router = new Router(); @@ -16,7 +15,7 @@ router.post('user.info', auth(), async (ctx) => { }); router.post('user.s3Upload', auth(), async (ctx) => { - let { filename, kind, size } = ctx.body; + const { filename, kind, size } = ctx.body; ctx.assertPresent(filename, 'filename is required'); ctx.assertPresent(kind, 'kind is required'); ctx.assertPresent(size, 'size is required'); @@ -26,24 +25,24 @@ router.post('user.s3Upload', auth(), async (ctx) => { const policy = makePolicy(); ctx.body = { data: { - max_upload_size: process.env.AWS_S3_UPLOAD_MAX_SIZE, - upload_url: process.env.AWS_S3_UPLOAD_BUCKET_URL, + max_upload_size: process.env.AWS_S3_UPLOAD_MAX_SIZE, + upload_url: process.env.AWS_S3_UPLOAD_BUCKET_URL, form: { - AWSAccessKeyId: process.env.AWS_ACCESS_KEY_ID, - "Cache-Control": "max-age=31557600", - "Content-Type": kind, - key: key, - acl: "public-read", - signature: signPolicy(policy), - policy: policy, + AWSAccessKeyId: process.env.AWS_ACCESS_KEY_ID, + 'Cache-Control': 'max-age=31557600', + 'Content-Type': kind, + key, + acl: 'public-read', + signature: signPolicy(policy), + policy, }, asset: { - content_type: kind, - url: `${process.env.AWS_S3_UPLOAD_BUCKET_URL}${s3Key}/${filename}`, - name: filename, - size: size, + content_type: kind, + url: `${process.env.AWS_S3_UPLOAD_BUCKET_URL}${s3Key}/${filename}`, + name: filename, + size, }, - }}; + } }; }); export default router;