aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPitu <[email protected]>2017-10-04 15:13:23 -0300
committerPitu <[email protected]>2017-10-04 15:13:23 -0300
commit759943f79811bdaf77bb90bcde2609c08f14e828 (patch)
tree7d2bd0bb29ada6aac9dc12600196f817bfda90d0
parentAsync who? (diff)
downloadhost.fuwn.me-759943f79811bdaf77bb90bcde2609c08f14e828.tar.xz
host.fuwn.me-759943f79811bdaf77bb90bcde2609c08f14e828.zip
whoops
-rw-r--r--controllers/uploadController.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/controllers/uploadController.js b/controllers/uploadController.js
index 42fccf5..508a30e 100644
--- a/controllers/uploadController.js
+++ b/controllers/uploadController.js
@@ -51,7 +51,7 @@ uploadsController.upload = async (req, res, next) => {
}
return uploadsController.actuallyUpload(req, res, user.id, albumid);
}
- return uploadsController.actuallyUpload(req, res, user.id, albumid);
+ return uploadsController.actuallyUpload(req, res, user, albumid);
};
uploadsController.actuallyUpload = async (req, res, userid, album) => {
@@ -81,7 +81,7 @@ uploadsController.actuallyUpload = async (req, res, userid, album) => {
const dbFile = await db.table('files')
.where(function() {
if (userid === undefined) this.whereNull('userid');
- else this.where('userid', userid);
+ else this.where('userid', userid.id);
})
.where({
hash: fileHash,
@@ -98,7 +98,7 @@ uploadsController.actuallyUpload = async (req, res, userid, album) => {
hash: fileHash,
ip: req.ip,
albumid: album,
- userid: userid,
+ userid: userid.id,
timestamp: Math.floor(Date.now() / 1000)
});
} else {