generated from VLADIMIR/template
up
This commit is contained in:
@@ -40,6 +40,14 @@ func (s *server) GetGameReviews(ctx context.Context, req *proto.GetGameReviewsRe
|
||||
return &proto.GetGameReviewsRsp{AverageRating: average, ReviewsCount: count, Reviews: mapGameReviews(reviews)}, nil
|
||||
}
|
||||
|
||||
func (s *server) GetScenarioReviews(ctx context.Context, req *proto.GetScenarioReviewsReq) (*proto.GetGameReviewsRsp, error) {
|
||||
reviews, average, count, err := s.reviewService.ListByScenario(ctx, int(req.ScenarioId))
|
||||
if err != nil {
|
||||
return &proto.GetGameReviewsRsp{Error: err.Error()}, nil
|
||||
}
|
||||
return &proto.GetGameReviewsRsp{AverageRating: average, ReviewsCount: count, Reviews: mapGameReviews(reviews)}, nil
|
||||
}
|
||||
|
||||
func (s *server) GetGameReviewsForModeration(ctx context.Context, req *proto.GetGameReviewsReq) (*proto.GetGameReviewsRsp, error) {
|
||||
claims := ctx.Value("claims").(*processor_jwt.JWTClaims)
|
||||
if !roles.HasRole(claims, roles.Admin) {
|
||||
|
||||
Reference in New Issue
Block a user