mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-10-30 14:49:14 +00:00
19 lines
594 B
TypeScript
19 lines
594 B
TypeScript
import type {EventTransaction} from 'sentry/types';
|
|
import {useApiQuery} from 'sentry/utils/queryClient';
|
|
import useOrganization from 'sentry/utils/useOrganization';
|
|
|
|
interface Props {
|
|
eventId?: EventTransaction['id'];
|
|
projectSlug?: string;
|
|
}
|
|
|
|
export function useEventDetails(props: Props) {
|
|
const organization = useOrganization();
|
|
const {eventId, projectSlug} = props;
|
|
|
|
return useApiQuery<EventTransaction>(
|
|
[`/organizations/${organization.slug}/events/${projectSlug}:${eventId}/`],
|
|
{staleTime: Infinity, enabled: Boolean(eventId && projectSlug && organization.slug)}
|
|
);
|
|
}
|