Skip to content

Commit

Permalink
fix: only fetch create and update events in secret history query (#106)
Browse files Browse the repository at this point in the history
Co-authored-by: Nimish <[email protected]>
  • Loading branch information
rohan-chaturvedi and nimish-ks authored Nov 12, 2023
1 parent 00e58f3 commit 150a68e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/backend/graphene/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class Meta:
# interfaces = (relay.Node, )

def resolve_history(self, info):
return SecretEvent.objects.filter(secret_id=self.id).order_by('timestamp')
return SecretEvent.objects.filter(secret_id=self.id, event_type__in=[SecretEvent.CREATE, SecretEvent.UPDATE]).order_by('timestamp')


class KMSLogType(ObjectType):
Expand Down
4 changes: 1 addition & 3 deletions frontend/components/environments/SecretRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,7 @@ const HistoryDialog = (props: { secret: SecretType }) => {
if (eventType === ApiSecretEventEventTypeChoices.D) return 'Deleted'
}

const secretHistory = secret.history?.filter(
(event: Maybe<SecretEventType>) => event?.eventType! !== ApiSecretEventEventTypeChoices.R
)
const secretHistory = secret.history

return (
<>
Expand Down

0 comments on commit 150a68e

Please sign in to comment.