handle-errors
authorPawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>
Mon, 16 Jul 2018 10:57:40 +0000 (12:57 +0200)
committerPawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>
Mon, 16 Jul 2018 10:57:40 +0000 (12:57 +0200)
Feature #13781

Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>

src/store/project/project-action.ts
src/views-components/dialog-create/dialog-project-create.tsx

index f7708ebe89295eea73f849929097a0a7c386e424..2d59a4842bc41b13ab0b4f8ab7f90cddaae63f8d 100644 (file)
@@ -46,7 +46,7 @@ export const createProject = (project: Partial<ProjectResource>) =>
         return projectService
             .create(projectData)
             .then(project => dispatch(actions.CREATE_PROJECT_SUCCESS(project)))
-            .catch(() => dispatch(actions.CREATE_PROJECT_ERROR("Could not create a project")));
+            .catch((response) => dispatch(actions.CREATE_PROJECT_ERROR(response.response.data.errors)));
     };
 
 export type ProjectAction = UnionOf<typeof actions>;
index 91e23bebbf6ce2c243afda7d9d7a6253e8b34599..48b89115e47e0fd58fba382f2e4ca7d2f5ee1bbb 100644 (file)
@@ -73,7 +73,7 @@ class DialogProjectCreate extends React.Component<ProjectCreateProps & WithStyle
                   fullWidth />} />
           </DialogContent>
           <DialogActions>
-            <Button onClick={handleClose} className={classes.button} color="primary">CANCEL</Button>
+            <Button onClick={handleClose} className={classes.button} color="primary" disabled={pending}>CANCEL</Button>
             <Button onClick={this.handleSubmit} 
               className={classes.lastButton} 
               color="primary"