diff options
| author | Pitu <[email protected]> | 2017-01-18 04:05:56 -0300 |
|---|---|---|
| committer | Pitu <[email protected]> | 2017-01-18 04:05:56 -0300 |
| commit | 0dcaf36332cfa79f198a0cce04a1789822acd1ca (patch) | |
| tree | d0d5871a58f79d022b7abdd4a1661fd4a5f980eb /controllers/uploadController.js | |
| parent | lowercased headers (diff) | |
| download | host.fuwn.me-0dcaf36332cfa79f198a0cce04a1789822acd1ca.tar.xz host.fuwn.me-0dcaf36332cfa79f198a0cce04a1789822acd1ca.zip | |
Added browsing galleries from dashboard
Diffstat (limited to 'controllers/uploadController.js')
| -rw-r--r-- | controllers/uploadController.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/controllers/uploadController.js b/controllers/uploadController.js index 2828a19..cbb4e64 100644 --- a/controllers/uploadController.js +++ b/controllers/uploadController.js @@ -77,7 +77,14 @@ uploadsController.list = function(req, res){ if(req.headers.auth !== config.adminToken) return res.status(401).send('not-authorized') - db.table('files').then((files) => { + db.table('files') + .where(function(){ + if(req.headers.albumid === undefined) + this.where('id', '<>', '') + else + this.where('albumid', req.headers.albumid) + }) + .then((files) => { db.table('albums').then((albums) => { for(let file of files){ |