Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions routes/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ router.post('/dashboard/editprofile/del',auth,(req,res)=>{
})

router.get('/hackathons', auth, (req, res) => {
// const hackathonsFinished = [];
const hackathonsCurrent = [];
Hackathon.find({finished:false})
.sort({
Expand Down Expand Up @@ -88,7 +87,6 @@ router.get('/hackathons', auth, (req, res) => {
})
User.findOne({_id:req.user._id},(err,user)=>{
if(err) Error(err);
// console.log(user);
res.render('hackathons',{ hacksCurrent: hackathonsCurrent, user: user});
})
}
Expand Down Expand Up @@ -124,12 +122,10 @@ router.delete('/hackathons/insert/:hackathonid/:userid',auth, (req,res)=>{
if(err) Error("Could not process fetch request "+ err);
else if(!hackathon) console.log("Hackathon id invalid");
else {
// console.log(hackathon.participants);
User.findOne({_id: req.params.userid},async (err, user)=>{
if(err) Error("Could not process fetch request "+ err);
else if(!user) console.log("User id invalid");
else {
// console.log(userr);
let flag = 1;
for(let i=0;i<hackathon.participants.length;i++){
if(hackathon.participants[i].toString() == user._id.toString()){
Expand Down