Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EPICSYSTEM-96] redirect unpublished engagements to homepage. #62

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions met-api/src/met_api/resources/engagement.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ def get(engagement_id):
if engagement_record:
return engagement_record, HTTPStatus.OK

return 'Engagement was not found', HTTPStatus.INTERNAL_SERVER_ERROR
return 'Engagement was not found', HTTPStatus.NOT_FOUND
except KeyError:
return 'Engagement was not found', HTTPStatus.INTERNAL_SERVER_ERROR
return 'Engagement was not found', HTTPStatus.NOT_FOUND
except ValueError as err:
return str(err), HTTPStatus.INTERNAL_SERVER_ERROR

Expand Down
9 changes: 2 additions & 7 deletions met-web/src/components/engagement/view/ActionContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,7 @@ export const ActionProvider = ({ children }: { children: JSX.Element | JSX.Eleme
setSavedEngagement({ ...result });
setEngagementLoading(false);
} catch (error) {
dispatch(
openNotification({
severity: 'error',
text: 'Error occurred while fetching Engagement information',
}),
);
navigate('/');
}
};

Expand All @@ -186,7 +181,7 @@ export const ActionProvider = ({ children }: { children: JSX.Element | JSX.Eleme
dispatch(
openNotification({
severity: 'error',
text: 'Error occurred while fetching Engagement wdigets',
text: 'Error occurred while fetching Engagement widgets',
}),
);
}
Expand Down
Loading