useOrganizationFlagLog.tsx 546 B

12345678910111213141516171819
  1. import type {Organization} from 'sentry/types/organization';
  2. import {useApiQuery} from 'sentry/utils/queryClient';
  3. import type {RawFlagData} from 'sentry/views/issueDetails/streamline/featureFlagUtils';
  4. export function useOrganizationFlagLog({
  5. organization,
  6. query,
  7. }: {
  8. organization: Organization;
  9. query: Record<string, any>;
  10. }) {
  11. return useApiQuery<RawFlagData>(
  12. [`/organizations/${organization.slug}/flags/logs/`, {query}],
  13. {
  14. staleTime: 0,
  15. enabled: organization.features.includes('feature-flag-ui'),
  16. }
  17. );
  18. }