func (p *politeiawww) handleCastVotes(w http.ResponseWriter, r *http.Request) {
	log.Tracef("handleCastVotes")

	var cv v1.Ballot
	decoder := json.NewDecoder(r.Body)
	if err := decoder.Decode(&cv); err != nil {
		RespondWithError(w, r, 0, "handleCastVotes: unmarshal", v1.UserError{
			ErrorCode: v1.ErrorStatusInvalidInput,
		})
		return
	}

	avr, err := p.backend.ProcessCastVotes(&cv)
	if err != nil {
		RespondWithError(w, r, 0,
			"handleCastVotes: ProcessCastVotes %v", err)
		return
	}

	util.RespondWithJSON(w, http.StatusOK, avr)
}
// handleCastVotes records the user votes in politeiad.
handleCastVotes records the user votes in politeiad.
// handleCastVotes records the user votes in politeiad .
func (p *politeiawww) handleCastVotes(w http.ResponseWriter, r *http.Request) {
	log.Tracef("handleCastVotes")
	var cv v1.Ballot
	decoder := json.NewDecoder(r.Body)
	if err := decoder.Decode(&cv); err != nil {
		RespondWithError(w, r, 0, "handleCastVotes: unmarshal", v1.UserError{
			ErrorCode: v1.ErrorStatusInvalidInput,
		})
		return
	}
	avr, err := p.backend.ProcessCastVotes(&cv)
	if err != nil {
		RespondWithError(w, r, 0,
			"handleCastVotes: ProcessCastVotes %v", err)
		return
	}
	util.RespondWithJSON(w, http.StatusOK, avr)
}
func ( p * politeiawww ) handleCastVotes ( w http . ResponseWriter , r * http . Request ) { log . Tracef ( " " ) var cv v1 . Ballot decoder := json . NewDecoder ( r . Body ) if err := decoder . Decode ( & cv ) ; err != nil { RespondWithError ( w , r , 0 , " " , v1 . UserError { ErrorCode : v1 . ErrorStatusInvalidInput , } ) return } avr , err := p . backend . ProcessCastVotes ( & cv ) if err != nil { RespondWithError ( w , r , 0 , " " , err ) return } util . RespondWithJSON ( w , http . StatusOK , avr ) }
handleCastVotes records the user votes in politeiad.
handleCastVotes records the user votes in politeiad .