MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / handleListReviews

Method handleListReviews

internal/httpapi/reviews.go:105–122  ·  view source on GitHub ↗
(ctx context.Context, _ *struct{})

Source from the content-addressed store, hash-verified

103}
104
105func (s *Server) handleListReviews(ctx context.Context, _ *struct{}) (*listReviewsOutput, error) {
106 p, err := s.requireAccountScope(ctx)
107 if err != nil {
108 return nil, err
109 }
110 if s.deps.ListReviews == nil {
111 return nil, NewError(http.StatusNotImplemented, "not_implemented", "reviews are not available on this deployment")
112 }
113 items, err := s.deps.ListReviews(ctx, p.User.ID)
114 if err != nil {
115 return nil, NewError(http.StatusInternalServerError, "internal_error", "failed to list reviews")
116 }
117 views := make([]ReviewView, 0, len(items))
118 for _, it := range items {
119 views = append(views, reviewView(it))
120 }
121 return &listReviewsOutput{Body: NewPage(views, "")}, nil
122}
123
124// requireOwnedReview resolves a held message by id, scoped to the account, and
125// returns it (404 if it isn't a hold the account owns). The ownership check is

Callers

nothing calls this directly

Calls 6

requireAccountScopeMethod · 0.95
NewErrorFunction · 0.85
makeFunction · 0.85
reviewViewFunction · 0.85
NewPageFunction · 0.85
ListReviewsMethod · 0.80

Tested by

no test coverage detected