aboutsummaryrefslogtreecommitdiff
path: root/controllers/uploadController.js
diff options
context:
space:
mode:
authorPitu <[email protected]>2017-01-18 04:05:56 -0300
committerPitu <[email protected]>2017-01-18 04:05:56 -0300
commit0dcaf36332cfa79f198a0cce04a1789822acd1ca (patch)
treed0d5871a58f79d022b7abdd4a1661fd4a5f980eb /controllers/uploadController.js
parentlowercased headers (diff)
downloadhost.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.js9
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){