|
|
@ -104,7 +104,7 @@ func GetVoteType(voteID int) (string, error) {
|
|
|
|
func UpdateVote(voteID int, userID string, voteValue int) error {
|
|
|
|
func UpdateVote(voteID int, userID string, voteValue int) error {
|
|
|
|
if voteValue == ForceRejectionVote {
|
|
|
|
if voteValue == ForceRejectionVote {
|
|
|
|
//Check if they used it within a month.
|
|
|
|
//Check if they used it within a month.
|
|
|
|
rows, err := db.Query("SELECT voteId FROM choices WHERE date >= ? AND value=?", time.Now().AddDate(0, -1, 0))
|
|
|
|
rows, err := db.Query("SELECT voteId FROM choices WHERE date >= ? AND value=?", time.Now().AddDate(0, -1, 0), ForceRejectionVote)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|