Skip to content

Commit

Permalink
hit counter added and bugged fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
sudhakarshah committed Mar 15, 2018
1 parent 77c6488 commit 0e81e75
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions models/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var projectSchema = new Schema({
description:{type:String, required:true},
//image:{ data: Buffer, contentType: String }
imagePath:{type:String,required:true},
hitCount: { type: Number, default: 0 },
tags: [Schema.Types.ObjectId],
roles:[Schema.Types.ObjectId]

Expand Down
6 changes: 3 additions & 3 deletions routes/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ router.post('/',function(req,res){
Account.findOne({emailId: req.body.emailId},function(error,account)
{
if (error)
return console.log("Error in accessing database");
return console.log("Error in accessing database. "+ error);

if (!account)
return res.render('login', { title: "login" , message: "emailId doesnot Exists"});
// creating a new session
if(!isVerified)
if(!account.isVerified)
return res.send("Please verify your account");

if (account.compare(req.body.password)){
req.session.user = account;
req.session.save();
Expand Down
1 change: 1 addition & 0 deletions routes/newproject.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ function createProject(pAuthor,pTitle,pDescription,pImagePath,callback){
title: pTitle,
description:pDescription,
imagePath:pImagePath,
hitCount:0,
tags:listOfTagsId,
roles:listOfRolesId
},function(error,addedProject){
Expand Down
1 change: 1 addition & 0 deletions routes/signup.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ router.post('/',function(req,res){
emailId : req.body.emailId,
password : req.body.password,
fullName: req.body.fullName,
isVerified: false,
verificationLink:rand,
projects:[]
},function(error,account){
Expand Down

0 comments on commit 0e81e75

Please sign in to comment.