func (p *politeiawww) handleNewProposal(w http.ResponseWriter, r *http.Request) {
	// Get the new proposal command.
	log.Tracef("handleNewProposal")
	var np v1.NewProposal
	decoder := json.NewDecoder(r.Body)
	if err := decoder.Decode(&np); err != nil {
		RespondWithError(w, r, 0, "handleNewProposal: unmarshal", v1.UserError{
			ErrorCode: v1.ErrorStatusInvalidInput,
		})
		return
	}

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

	reply, err := p.backend.ProcessNewProposal(np, user)
	if err != nil {
		RespondWithError(w, r, 0,
			"handleNewProposal: ProcessNewProposal %v", err)
		return
	}

	// Reply with the challenge response and censorship token.
	util.RespondWithJSON(w, http.StatusOK, reply)
}
// handleNewProposal handles the incoming new proposal command.
handleNewProposal handles the incoming new proposal command.
// handleNewProposal handles the incoming new proposal command .
func (p *politeiawww) handleNewProposal(w http.ResponseWriter, r *http.Request) {
	log.Tracef("handleNewProposal")
	var np v1.NewProposal
	decoder := json.NewDecoder(r.Body)
	if err := decoder.Decode(&np); err != nil {
		RespondWithError(w, r, 0, "handleNewProposal: unmarshal", v1.UserError{
			ErrorCode: v1.ErrorStatusInvalidInput,
		})
		return
	}
	user, err := p.getSessionUser(r)
	if err != nil {
		RespondWithError(w, r, 0,
			"handleNewProposal: getSessionUser %v", err)
		return
	}
	reply, err := p.backend.ProcessNewProposal(np, user)
	if err != nil {
		RespondWithError(w, r, 0,
			"handleNewProposal: ProcessNewProposal %v", err)
		return
	}
	util.RespondWithJSON(w, http.StatusOK, reply)
}
func ( p * politeiawww ) handleNewProposal ( w http . ResponseWriter , r * http . Request ) { log . Tracef ( " " ) var np v1 . NewProposal decoder := json . NewDecoder ( r . Body ) if err := decoder . Decode ( & np ) ; 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 } reply , err := p . backend . ProcessNewProposal ( np , user ) if err != nil { RespondWithError ( w , r , 0 , " " , err ) return } util . RespondWithJSON ( w , http . StatusOK , reply ) }
handleNewProposal handles the incoming new proposal command.
handleNewProposal handles the incoming new proposal command .
// Get the new proposal command. // Reply with the challenge response and censorship token.