sentryAppComponents.tsx 520 B

123456789101112131415
  1. import {Client} from 'sentry/api';
  2. import SentryAppComponentsStore from 'sentry/stores/sentryAppComponentsStore';
  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. SentryAppComponentsStore.loadComponents(res);
  12. return res;
  13. }