Skip to content

Commit b804a68

Browse files
committed
bugfix change value
1 parent c17bd53 commit b804a68

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

controllers/backend/internalApi.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -604,10 +604,6 @@ exports.react = async(req, res, next) => {
604604
/** POST EDIT UPLOAD **/
605605
exports.editUpload = async(req, res, next) => {
606606

607-
// console.log(req.body);
608-
//
609-
// return res.send('hello');
610-
611607
try {
612608

613609
if(!req.user && req.body.uploadToken){
@@ -656,7 +652,11 @@ exports.editUpload = async(req, res, next) => {
656652
// had to do this check for if the body has a visibility, if it's pending it will brick
657653
// TODO: should be changed such that pending is pendingApproval and not a visibility
658654
// only allow user to change visibility if they have plus, or if it's an admin or moderator
659-
if((upload.uploader.plan === 'plus' || isModeratorOrAdmin) && req.body.visibilty){
655+
656+
const isPlusOrModeratorOrAdmin = upload.uploader.plan === 'plus' || isModeratorOrAdmin;
657+
const visibilityValue = req.body.visibility;
658+
659+
if(isPlusOrModeratorOrAdmin && visibilityValue){
660660
upload.visibility = req.body.visibility;
661661
}
662662
upload.rating = req.body.rating;

0 commit comments

Comments
 (0)