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

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

	// Set status
	reply, err := p.backend.ProcessSetProposalStatus(sps, user)
	if err != nil {
		RespondWithError(w, r, 0,
			"handleSetProposalStatus: ProcessSetProposalStatus %v", err)
		return
	}

	// Reply with the new proposal status.
	util.RespondWithJSON(w, http.StatusOK, reply)
}
// handleSetProposalStatus handles the incoming set proposal status command.
// It's used for either publishing or censoring a proposal.
handleSetProposalStatus handles the incoming set proposal status command.
It's used for either publishing or censoring a proposal.
// handleSetProposalStatus handles the incoming set proposal status command . // It ' s used for either publishing or censoring a proposal .
func (p *politeiawww) handleSetProposalStatus(w http.ResponseWriter, r *http.Request) {
	log.Tracef("handleSetProposalStatus")
	var sps v1.SetProposalStatus
	decoder := json.NewDecoder(r.Body)
	if err := decoder.Decode(&sps); err != nil {
		RespondWithError(w, r, 0, "handleSetProposalStatus: unmarshal", v1.UserError{
			ErrorCode: v1.ErrorStatusInvalidInput,
		})
		return
	}
	user, err := p.getSessionUser(r)
	if err != nil {
		RespondWithError(w, r, 0,
			"handleSetProposalStatus: getSessionUser %v", err)
		return
	}
	reply, err := p.backend.ProcessSetProposalStatus(sps, user)
	if err != nil {
		RespondWithError(w, r, 0,
			"handleSetProposalStatus: ProcessSetProposalStatus %v", err)
		return
	}
	util.RespondWithJSON(w, http.StatusOK, reply)
}
func ( p * politeiawww ) handleSetProposalStatus ( w http . ResponseWriter , r * http . Request ) { log . Tracef ( " " ) var sps v1 . SetProposalStatus decoder := json . NewDecoder ( r . Body ) if err := decoder . Decode ( & sps ) ; 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 . ProcessSetProposalStatus ( sps , user ) if err != nil { RespondWithError ( w , r , 0 , " " , err ) return } util . RespondWithJSON ( w , http . StatusOK , reply ) }
handleSetProposalStatus handles the incoming set proposal status command.
handleSetProposalStatus handles the incoming set proposal status command .
// Get the proposal status command. // Set status // Reply with the new proposal status.