Skip to content

Commit

Permalink
Discussion Added
Browse files Browse the repository at this point in the history
  • Loading branch information
nitin-1926 committed Oct 2, 2019
1 parent bc13428 commit 8b6a7ec
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 46 deletions.
2 changes: 0 additions & 2 deletions public/discussion.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ window.onload = function()
request.onload = function()
{
var data = JSON.parse(request.responseText);
console.log(data);
for(var i in data.communitydiscussion)
{
addtoDOM(data.communitydiscussion[i]);
Expand All @@ -19,7 +18,6 @@ window.onload = function()
}
function addtoDOM(obj)
{
console.log(obj);
var div = '<div class="container discussion-container">'
+'<div class="panel panel-default allSidesSoft" style="background:white;">'
+'<div class="dropup">'
Expand Down
Binary file added public/uploadimages/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 43 additions & 43 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -1192,48 +1192,48 @@ app.post('/removeUser',function(req,res)
})
})

// app.post('/promoteUser',function(req,res)
// {
// community.updateOne( { "_id" : req.body.commid } , { $push : { communitymanager : req.body.userid } , $pull : { communitymember : { $in : [req.body.userid] } } },function(err,result)
// {
// if(err)
// throw err;
// else {
// product.updateOne( { "_id" : req.body.userid } , { $push : { manager : req.body.commid } , $pull : { join : { $in : [req.body.commid] } } },function(err,result)
// {
// if(err)
// throw err;
// else {
// res.send("DONE");
// }
// })
// }
// })
// })

// app.post('/getObj',function(req,res)
// {
// res.send(req.session.data);
// })

// app.post('/demoteUser',function(req,res)
// {
// community.updateOne( { "_id" : req.body.commid } , { $push : { communitymember : req.body.userid } , $pull : { communitymanager : { $in : [req.body.userid] } } },function(err,result)
// {
// if(err)
// throw err;
// else {
// product.updateOne( { "_id" : req.body.userid } , { $push : { join : req.body.commid } , $pull : { manager : { $in : [req.body.commid] } } },function(err,result)
// {
// if(err)
// throw err;
// else {
// res.send("DONE");
// }
// })
// }
// })
// })
app.post('/promoteUser',function(req,res)
{
community.updateOne( { "_id" : req.body.commid } , { $push : { communitymanager : req.body.userid } , $pull : { communitymember : { $in : [req.body.userid] } } },function(err,result)
{
if(err)
throw err;
else {
product.updateOne( { "_id" : req.body.userid } , { $push : { manager : req.body.commid } , $pull : { join : { $in : [req.body.commid] } } },function(err,result)
{
if(err)
throw err;
else {
res.send("DONE");
}
})
}
})
})

app.post('/getObj',function(req,res)
{
res.send(req.session.data);
})

app.post('/demoteUser',function(req,res)
{
community.updateOne( { "_id" : req.body.commid } , { $push : { communitymember : req.body.userid } , $pull : { communitymanager : { $in : [req.body.userid] } } },function(err,result)
{
if(err)
throw err;
else {
product.updateOne( { "_id" : req.body.userid } , { $push : { join : req.body.commid } , $pull : { manager : { $in : [req.body.commid] } } },function(err,result)
{
if(err)
throw err;
else {
res.send("DONE");
}
})
}
})
})

app.get('/community/list',logger,function(req,res)
{
Expand Down Expand Up @@ -1359,7 +1359,7 @@ app.post('/createDiscussion/:pro',function(req,res)
if(error)
throw error;
else {
res.send("DiSCUSSSION ENTERED");
res.redirect('back');
}
})
})
Expand Down
1 change: 0 additions & 1 deletion views/switchcommunitydiscussions.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<input type="text" style="width:100%;" class="discussion-input-title" name="title" placeholder="Enter a discussion title....." id="discussion-title" autocomplete="off" required="">
</div>
</div>

<div class="panel-body discussion-body" style="display:block;">

<div class="col-sm-12 col-xs-12" style="padding:0;border-top: 1px solid white;">
Expand Down

0 comments on commit 8b6a7ec

Please sign in to comment.