diff options
| author | Pitu <[email protected]> | 2017-01-19 03:04:22 -0300 |
|---|---|---|
| committer | Pitu <[email protected]> | 2017-01-19 03:04:22 -0300 |
| commit | 5d09892ec1424c62df5a794023f95dd051beda7f (patch) | |
| tree | 5e0f0e70d152d83199ac747561edef31cca84a70 /controllers | |
| parent | Changed request system and post data (diff) | |
| download | host.fuwn.me-5d09892ec1424c62df5a794023f95dd051beda7f.tar.xz host.fuwn.me-5d09892ec1424c62df5a794023f95dd051beda7f.zip | |
Ohboi
Diffstat (limited to 'controllers')
| -rw-r--r-- | controllers/uploadController.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/controllers/uploadController.js b/controllers/uploadController.js index 499bdb7..8f4b092 100644 --- a/controllers/uploadController.js +++ b/controllers/uploadController.js @@ -26,7 +26,7 @@ uploadsController.upload = function(req, res, next){ if(req.headers.auth !== config.clientToken) return res.status(401).json({ success: false, description: 'not-authorized'}) - let album = req.body.album + let album = req.params.albumid if(album !== undefined) if(req.headers.adminauth !== config.adminToken) @@ -41,6 +41,8 @@ uploadsController.upload = function(req, res, next){ }) } + if(req.files.length === 0) return res.json({ success: false, description: 'no-files' }) + let files = [] req.files.forEach(function(file) { files.push({ |