aboutsummaryrefslogtreecommitdiff
path: root/src/api/routes/albums
diff options
context:
space:
mode:
authorPitu <[email protected]>2019-03-02 02:08:11 +0900
committerPitu <[email protected]>2019-03-02 02:08:11 +0900
commit73d85e8c7938e1db30da3cc4354b143d4a078473 (patch)
tree168f25e4d4a6cff7cd21b07f8b3df417ab28ab9e /src/api/routes/albums
parentCreate pm2.md (diff)
downloadhost.fuwn.me-73d85e8c7938e1db30da3cc4354b143d4a078473.tar.xz
host.fuwn.me-73d85e8c7938e1db30da3cc4354b143d4a078473.zip
Enviroment variables parsing fix
Diffstat (limited to 'src/api/routes/albums')
-rw-r--r--src/api/routes/albums/link/linkPOST.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/api/routes/albums/link/linkPOST.js b/src/api/routes/albums/link/linkPOST.js
index 968e57d..e929c89 100644
--- a/src/api/routes/albums/link/linkPOST.js
+++ b/src/api/routes/albums/link/linkPOST.js
@@ -22,7 +22,7 @@ class linkPOST extends Route {
Count the amount of links created for that album already and error out if max was reached
*/
const count = await db.table('links').where('albumId', albumId).count({ count: 'id' });
- if (count[0].count >= process.env.MAX_LINKS_PER_ALBUM) return res.status(400).json({ message: 'Maximum links per album reached' });
+ if (count[0].count >= parseInt(process.env.MAX_LINKS_PER_ALBUM, 10)) return res.status(400).json({ message: 'Maximum links per album reached' });
/*
Try to allocate a new identifier on the db