platformExternalIssues.tsx 629 B

12345678910111213141516171819202122232425
  1. import PlatformExternalIssueActions from 'sentry/actions/platformExternalIssueActions';
  2. import {Client} from 'sentry/api';
  3. export async function deleteExternalIssue(
  4. api: Client,
  5. groupId: string,
  6. externalIssueId: string
  7. ) {
  8. PlatformExternalIssueActions.delete(groupId, externalIssueId);
  9. try {
  10. const data = await api.requestPromise(
  11. `/issues/${groupId}/external-issues/${externalIssueId}/`,
  12. {
  13. method: 'DELETE',
  14. }
  15. );
  16. PlatformExternalIssueActions.deleteSuccess(data);
  17. return data;
  18. } catch (error) {
  19. PlatformExternalIssueActions.deleteError(error);
  20. throw error;
  21. }
  22. }