aboutsummaryrefslogtreecommitdiff
path: root/src/api/routes
diff options
context:
space:
mode:
authorPitu <[email protected]>2020-12-24 23:45:16 +0900
committerPitu <[email protected]>2020-12-24 23:45:16 +0900
commitfb2c27086f570fec60f4d52dcc9ca80e53186293 (patch)
tree4c4fd056c293b8e0de632023ef19fdea95c009fa /src/api/routes
parentMerge pull request #228 from Zephyrrus/begone_trailing_commas (diff)
downloadhost.fuwn.me-fb2c27086f570fec60f4d52dcc9ca80e53186293.tar.xz
host.fuwn.me-fb2c27086f570fec60f4d52dcc9ca80e53186293.zip
Fix ESLint rules once and for all
Diffstat (limited to 'src/api/routes')
-rw-r--r--src/api/routes/albums/albumZipGET.js4
-rw-r--r--src/api/routes/files/filesAlbumsGET.js2
-rw-r--r--src/api/routes/uploads/uploadPOST.js4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/api/routes/albums/albumZipGET.js b/src/api/routes/albums/albumZipGET.js
index cf1f6f8..26da2ba 100644
--- a/src/api/routes/albums/albumZipGET.js
+++ b/src/api/routes/albums/albumZipGET.js
@@ -64,11 +64,11 @@ class albumGET extends Route {
/*
Get the actual files
*/
- const fileIds = fileList.map((el) => el.fileId);
+ const fileIds = fileList.map(el => el.fileId);
const files = await db.table('files')
.whereIn('id', fileIds)
.select('name');
- const filesToZip = files.map((el) => el.name);
+ const filesToZip = files.map(el => el.name);
try {
Util.createZip(filesToZip, album);
diff --git a/src/api/routes/files/filesAlbumsGET.js b/src/api/routes/files/filesAlbumsGET.js
index 90aa654..7f1190c 100644
--- a/src/api/routes/files/filesAlbumsGET.js
+++ b/src/api/routes/files/filesAlbumsGET.js
@@ -18,7 +18,7 @@ class filesGET extends Route {
.select('albumId');
if (albumFiles.length) {
- albumFiles = albumFiles.map((a) => a.albumId);
+ albumFiles = albumFiles.map(a => a.albumId);
albums = await db.table('albums')
.whereIn('id', albumFiles)
.select('id', 'name');
diff --git a/src/api/routes/uploads/uploadPOST.js b/src/api/routes/uploads/uploadPOST.js
index 567862a..5458d48 100644
--- a/src/api/routes/uploads/uploadPOST.js
+++ b/src/api/routes/uploads/uploadPOST.js
@@ -56,7 +56,7 @@ class uploadPOST extends Route {
if (!album) return res.status(401).json({ message: 'Album doesn\'t exist or it doesn\'t belong to the user' });
}
- return upload(req, res, async (err) => {
+ return upload(req, res, async err => {
if (err) console.error(err.message);
let uploadedFile = {};
@@ -142,7 +142,7 @@ class uploadPOST extends Route {
async checkIfFileExists(db, user, hash) {
const exists = await db.table('files')
- .where(function () { // eslint-disable-line func-names
+ .where(function() { // eslint-disable-line func-names
if (user) this.where('userId', user.id);
else this.whereNull('userId');
})