sentryAppComponents.tsx 526 B

123456789101112131415
  1. import SentryAppComponentsActions from 'sentry/actions/sentryAppComponentActions';
  2. import {Client} from 'sentry/api';
  3. import {SentryAppComponent} from 'sentry/types';
  4. export async function fetchSentryAppComponents(
  5. api: Client,
  6. orgSlug: string,
  7. projectId: string
  8. ): Promise<SentryAppComponent[]> {
  9. const componentsUri = `/organizations/${orgSlug}/sentry-app-components/?projectId=${projectId}`;
  10. const res = await api.requestPromise(componentsUri);
  11. SentryAppComponentsActions.loadComponents(res);
  12. return res;
  13. }