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

	// Get the user proposals command.
	var up v1.UserProposals
	err := util.ParseGetParams(r, &up)
	if err != nil {
		RespondWithError(w, r, 0, "handleUserProposals: ParseGetParams",
			v1.UserError{
				ErrorCode: v1.ErrorStatusInvalidInput,
			})
		return
	}

	userId, err := strconv.ParseUint(up.UserId, 10, 64)
	if err != nil {
		RespondWithError(w, r, 0, "handleUserProposals: ParseUint",
			v1.UserError{
				ErrorCode: v1.ErrorStatusInvalidInput,
			})
		return
	}

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

	upr, err := p.backend.ProcessUserProposals(
		&up,
		user != nil && user.ID == userId,
		user != nil && user.Admin)
	if err != nil {
		RespondWithError(w, r, 0,
			"handleUserProposals: ProcessUserProposals %v", err)
		return
	}

	util.RespondWithJSON(w, http.StatusOK, upr)
}
// handleUserProposals returns the proposals for the given user.
handleUserProposals returns the proposals for the given user.
// handleUserProposals returns the proposals for the given user .
func (p *politeiawww) handleUserProposals(w http.ResponseWriter, r *http.Request) {
	log.Tracef("handleUserProposals")
	var up v1.UserProposals
	err := util.ParseGetParams(r, &up)
	if err != nil {
		RespondWithError(w, r, 0, "handleUserProposals: ParseGetParams",
			v1.UserError{
				ErrorCode: v1.ErrorStatusInvalidInput,
			})
		return
	}
	userId, err := strconv.ParseUint(up.UserId, 10, 64)
	if err != nil {
		RespondWithError(w, r, 0, "handleUserProposals: ParseUint",
			v1.UserError{
				ErrorCode: v1.ErrorStatusInvalidInput,
			})
		return
	}
	user, err := p.getSessionUser(r)
	if err != nil {
		RespondWithError(w, r, 0,
			"handleUserProposals: getSessionUser %v", err)
		return
	}
	upr, err := p.backend.ProcessUserProposals(
		&up,
		user != nil && user.ID == userId,
		user != nil && user.Admin)
	if err != nil {
		RespondWithError(w, r, 0,
			"handleUserProposals: ProcessUserProposals %v", err)
		return
	}
	util.RespondWithJSON(w, http.StatusOK, upr)
}
func ( p * politeiawww ) handleUserProposals ( w http . ResponseWriter , r * http . Request ) { log . Tracef ( " " ) var up v1 . UserProposals err := util . ParseGetParams ( r , & up ) if err != nil { RespondWithError ( w , r , 0 , " " , v1 . UserError { ErrorCode : v1 . ErrorStatusInvalidInput , } ) return } userId , err := strconv . ParseUint ( up . UserId , 10 , 64 ) if 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 } upr , err := p . backend . ProcessUserProposals ( & up , user != nil && user . ID == userId , user != nil && user . Admin ) if err != nil { RespondWithError ( w , r , 0 , " " , err ) return } util . RespondWithJSON ( w , http . StatusOK , upr ) }
handleUserProposals returns the proposals for the given user.
handleUserProposals returns the proposals for the given user .
// Get the user proposals command.