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

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

	user, err := p.getSessionUser(r)
	if err != nil {
		RespondWithError(w, r, 0,
			"handleNewComment: getSessionUser %v", err)
		return
	}

	cr, err := p.backend.ProcessComment(sc, user)
	if err != nil {
		RespondWithError(w, r, 0,
			"handleNewComment: ProcessComment %v", err)
		return
	}

	util.RespondWithJSON(w, http.StatusOK, cr)
}
// handleNewComment handles incomming comments.
handleNewComment handles incomming comments.
// handleNewComment handles incomming comments .
func (p *politeiawww) handleNewComment(w http.ResponseWriter, r *http.Request) {
	log.Tracef("handleNewComment")
	var sc v1.NewComment
	decoder := json.NewDecoder(r.Body)
	if err := decoder.Decode(&sc); err != nil {
		RespondWithError(w, r, 0, "handleNewComment: unmarshal",
			v1.UserError{
				ErrorCode: v1.ErrorStatusInvalidInput,
			})
		return
	}
	user, err := p.getSessionUser(r)
	if err != nil {
		RespondWithError(w, r, 0,
			"handleNewComment: getSessionUser %v", err)
		return
	}
	cr, err := p.backend.ProcessComment(sc, user)
	if err != nil {
		RespondWithError(w, r, 0,
			"handleNewComment: ProcessComment %v", err)
		return
	}
	util.RespondWithJSON(w, http.StatusOK, cr)
}
func ( p * politeiawww ) handleNewComment ( w http . ResponseWriter , r * http . Request ) { log . Tracef ( " " ) var sc v1 . NewComment decoder := json . NewDecoder ( r . Body ) if err := decoder . Decode ( & sc ) ; err != nil { RespondWithError ( w , r , 0 , " " , v1 . UserError { ErrorCode : v1 . ErrorStatusInvalidInput , } ) return } user , err := p . getSessionUser ( r ) if err != nil { RespondWithError ( w , r , 0 , " " , err ) return } cr , err := p . backend . ProcessComment ( sc , user ) if err != nil { RespondWithError ( w , r , 0 , " " , err ) return } util . RespondWithJSON ( w , http . StatusOK , cr ) }
handleNewComment handles incomming comments.
handleNewComment handles incomming comments .