useGroupUserFeedback.tsx 564 B

123456789101112131415161718192021
  1. import type {UserReport} from 'sentry/types/group';
  2. import {useApiQuery} from 'sentry/utils/queryClient';
  3. import useOrganization from 'sentry/utils/useOrganization';
  4. interface UseGroupUserFeedbackProps {
  5. groupId: string;
  6. query: {
  7. cursor?: string | undefined;
  8. };
  9. }
  10. export function useGroupUserFeedback({groupId, query}: UseGroupUserFeedbackProps) {
  11. const organization = useOrganization();
  12. return useApiQuery<UserReport[]>(
  13. [`/organizations/${organization.slug}/issues/${groupId}/user-reports/`, {query}],
  14. {
  15. staleTime: 0,
  16. }
  17. );
  18. }