discoverHomepageQueries.tsx 697 B

12345678910111213141516171819202122232425
  1. import {Client} from 'sentry/api';
  2. import {NewQuery, SavedQuery} from 'sentry/types';
  3. export function fetchHomepageQuery(api: Client, orgId: string): Promise<SavedQuery> {
  4. return api.requestPromise(`/organizations/${orgId}/discover/homepage/`, {
  5. method: 'GET',
  6. });
  7. }
  8. export function updateHomepageQuery(
  9. api: Client,
  10. orgId: string,
  11. query: NewQuery
  12. ): Promise<SavedQuery> {
  13. return api.requestPromise(`/organizations/${orgId}/discover/homepage/`, {
  14. method: 'PUT',
  15. data: query,
  16. });
  17. }
  18. export function deleteHomepageQuery(api: Client, orgId: string): Promise<void> {
  19. return api.requestPromise(`/organizations/${orgId}/discover/homepage/`, {
  20. method: 'DELETE',
  21. });
  22. }