Remove pending entry count field
Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This commit is contained in:
committed by
Bryan Frimin
parent
ba2a47d262
commit
9c09562918
@@ -378,33 +378,6 @@ func (s *Service) CountEntriesForCampaignIDAndSourceID(
|
||||
return count, nil
|
||||
}
|
||||
|
||||
func (s *Service) CountPendingEntriesForCampaignID(
|
||||
ctx context.Context,
|
||||
scope coredata.Scoper,
|
||||
campaignID gid.GID,
|
||||
) (int, error) {
|
||||
var count int
|
||||
|
||||
err := s.pg.WithConn(
|
||||
ctx,
|
||||
func(ctx context.Context, conn pg.Querier) (err error) {
|
||||
entries := coredata.AccessReviewEntries{}
|
||||
|
||||
count, err = entries.CountPendingByCampaignID(ctx, conn, scope, campaignID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot count pending access entries: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return count, nil
|
||||
}
|
||||
|
||||
func (s *Service) EntryDecisionHistory(
|
||||
ctx context.Context,
|
||||
scope coredata.Scoper,
|
||||
|
||||
@@ -98,23 +98,6 @@ func (r *accessReviewCampaignResolver) Entries(ctx context.Context, obj *types.A
|
||||
return types.NewAccessReviewEntryConnection(p, r, obj.ID, nil, filter), nil
|
||||
}
|
||||
|
||||
// PendingEntryCount is the resolver for the pendingEntryCount field.
|
||||
func (r *accessReviewCampaignResolver) PendingEntryCount(ctx context.Context, obj *types.AccessReviewCampaign) (int, error) {
|
||||
scope, err := r.authorize(ctx, obj.ID, accessreview.ActionEntryList)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
count, err := r.accessReview.CountPendingEntriesForCampaignID(ctx, scope, obj.ID)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot count pending access entries", log.Error(err))
|
||||
|
||||
return 0, gqlutils.Internal(ctx)
|
||||
}
|
||||
|
||||
return count, nil
|
||||
}
|
||||
|
||||
// Statistics is the resolver for the statistics field.
|
||||
func (r *accessReviewCampaignResolver) Statistics(ctx context.Context, obj *types.AccessReviewCampaign) (*types.AccessReviewStatistics, error) {
|
||||
scope, err := r.authorize(ctx, obj.ID, accessreview.ActionEntryList)
|
||||
|
||||
@@ -364,8 +364,6 @@ type AccessReviewCampaign implements Node {
|
||||
filter: AccessReviewEntryFilter
|
||||
): AccessReviewEntryConnection! @goField(forceResolver: true)
|
||||
|
||||
pendingEntryCount: Int! @goField(forceResolver: true)
|
||||
|
||||
statistics: AccessReviewStatistics! @goField(forceResolver: true)
|
||||
|
||||
permission(action: String!): Boolean! @goField(forceResolver: true)
|
||||
|
||||
Reference in New Issue
Block a user