utils.tsx 509 B

1234567891011121314151617
  1. import {EventAttachment} from 'sentry/types';
  2. import {Event} from 'sentry/types/event';
  3. export type ViewerProps = {
  4. attachment: EventAttachment;
  5. event: Event;
  6. orgId: string;
  7. projectId: string;
  8. className?: string;
  9. };
  10. export function getAttachmentUrl(props: ViewerProps, withPrefix?: boolean): string {
  11. const {orgId, projectId, event, attachment} = props;
  12. return `${withPrefix ? '/api/0' : ''}/projects/${orgId}/${projectId}/events/${
  13. event.id
  14. }/attachments/${attachment.id}/?download`;
  15. }