Family-Thief / family-thief

Collaborative writing platform
MIT License
3 stars 6 forks source link

Only allow one upvote #162

Closed ratracegrad closed 9 years ago

ratracegrad commented 9 years ago

Added a hasVoted Yet function in help-request.controller.js. This function checks to see if the user has currently voted on the project or not. Modified $scope.upvote function to call my new hasVotedYet function first so that it sets whether or not the user has voted. If user has voted then does an alert. Added a module.exports.projectHasVoted. This project will first get the users id from the user table. Then it will do a search on the projectupvote table to see if user has currently voted on the current project. Returns true or false. Added route for /api/helpRequest/hasVoted in app.js. This route is called when checking to see if user has already voted on a project or not.

TheAdamizer commented 9 years ago

Instructed to disregard.