Browse Source

fix(ui): Add error message to organizationCreate (#43443)

Megan Heskett 2 years ago
parent
commit
dc76dcfd4e
1 changed files with 6 additions and 0 deletions
  1. 6 0
      static/app/views/organizationCreate.tsx

+ 6 - 0
static/app/views/organizationCreate.tsx

@@ -1,3 +1,4 @@
+import {addErrorMessage} from 'sentry/actionCreators/indicator';
 import {ApiForm, CheckboxField, TextField} from 'sentry/components/forms';
 import NarrowLayout from 'sentry/components/narrowLayout';
 import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
@@ -39,6 +40,11 @@ function OrganizationCreate() {
             // browserHistory.pushState(null, `/organizations/${data.slug}/projects/new/`);
             window.location.assign(nextUrl);
           }}
+          onSubmitError={error => {
+            addErrorMessage(
+              error.responseJSON?.detail ?? t('Unable to create organization.')
+            );
+          }}
           requireChanges
         >
           <TextField