mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-13 16:06:21 +00:00
whoops
This commit is contained in:
parent
76d48602c6
commit
759943f798
@ -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.id, albumid);
|
return uploadsController.actuallyUpload(req, res, user, albumid);
|
||||||
};
|
};
|
||||||
|
|
||||||
uploadsController.actuallyUpload = async (req, res, userid, album) => {
|
uploadsController.actuallyUpload = async (req, res, userid, album) => {
|
||||||
@ -81,7 +81,7 @@ uploadsController.actuallyUpload = async (req, res, userid, album) => {
|
|||||||
const dbFile = await db.table('files')
|
const dbFile = await db.table('files')
|
||||||
.where(function() {
|
.where(function() {
|
||||||
if (userid === undefined) this.whereNull('userid');
|
if (userid === undefined) this.whereNull('userid');
|
||||||
else this.where('userid', userid);
|
else this.where('userid', userid.id);
|
||||||
})
|
})
|
||||||
.where({
|
.where({
|
||||||
hash: fileHash,
|
hash: fileHash,
|
||||||
@ -98,7 +98,7 @@ uploadsController.actuallyUpload = async (req, res, userid, album) => {
|
|||||||
hash: fileHash,
|
hash: fileHash,
|
||||||
ip: req.ip,
|
ip: req.ip,
|
||||||
albumid: album,
|
albumid: album,
|
||||||
userid: userid,
|
userid: userid.id,
|
||||||
timestamp: Math.floor(Date.now() / 1000)
|
timestamp: Math.floor(Date.now() / 1000)
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user