From 4bb5de42a219dfe34bc5c5e7ffed09194cab11fb Mon Sep 17 00:00:00 2001 From: kyle-ssg Date: Wed, 5 Jun 2024 11:08:10 +0100 Subject: [PATCH] Fix error parsing for project provider --- frontend/common/providers/ProjectProvider.js | 1 + frontend/web/components/ErrorMessage.js | 2 +- frontend/web/components/pages/CreateEnvironmentPage.js | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/common/providers/ProjectProvider.js b/frontend/common/providers/ProjectProvider.js index f427a268ebfc..2f29fd73b75c 100644 --- a/frontend/common/providers/ProjectProvider.js +++ b/frontend/common/providers/ProjectProvider.js @@ -24,6 +24,7 @@ const ProjectProvider = class extends React.Component { this.setState( Object.assign( { + error: ProjectStore.error, isLoading: ProjectStore.isLoading, isSaving: ProjectStore.isSaving, }, diff --git a/frontend/web/components/ErrorMessage.js b/frontend/web/components/ErrorMessage.js index b1290f482a67..50c6e0f9e11b 100644 --- a/frontend/web/components/ErrorMessage.js +++ b/frontend/web/components/ErrorMessage.js @@ -12,7 +12,7 @@ export default class ErrorMessage extends PureComponent { const errorMessageClassName = `alert alert-danger ${ this.props.errorMessageClass || 'flex-1 align-items-center' }` - const error = this.props.error?.data || this.props.error + const error = this.props.error?.data || this.props.error?.message || this.props.error return this.props.error ? (
)} + {error && ( + + + + )}
- {error && }
{permission ? (