diff options
| author | Pitu <[email protected]> | 2017-01-30 04:42:15 -0300 |
|---|---|---|
| committer | Pitu <[email protected]> | 2017-01-30 04:42:15 -0300 |
| commit | 4a4ca06366aaadbb2bd2a6216e1bd2fb00f7af85 (patch) | |
| tree | 9fad71155173940f1ef584334b941bca1d4654a1 /controllers/uploadController.js | |
| parent | Unfucked my latest commit to this file (diff) | |
| download | host.fuwn.me-4a4ca06366aaadbb2bd2a6216e1bd2fb00f7af85.tar.xz host.fuwn.me-4a4ca06366aaadbb2bd2a6216e1bd2fb00f7af85.zip | |
Forgot it was an array
Diffstat (limited to 'controllers/uploadController.js')
| -rw-r--r-- | controllers/uploadController.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/controllers/uploadController.js b/controllers/uploadController.js index d6f8ad5..6b398cc 100644 --- a/controllers/uploadController.js +++ b/controllers/uploadController.js @@ -36,7 +36,7 @@ uploadsController.upload = function(req, res, next){ db.table('users').where('token', token).then((user) => { let userid if(user.length > 0) - userid = user.id + userid = user[0].id // Check if user is trying to upload to an album let album = undefined @@ -161,8 +161,8 @@ uploadsController.delete = function(req, res){ db.table('files') .where('id', id) .where(function(){ - if(user.username !== 'root') - this.where('userid', user.id) + if(user[0].username !== 'root') + this.where('userid', user[0].id) }) .then((file) => { @@ -215,8 +215,8 @@ uploadsController.list = function(req, res){ this.where('albumid', req.params.id) }) .where(function(){ - if(user.username !== 'root') - this.where('userid', user.id) + if(user[0].username !== 'root') + this.where('userid', user[0].id) }) .orderBy('id', 'DESC') .limit(25) |