Skip to content

Commit

Permalink
[EPICSYSTEM-96] redirect unpublished engagements to homepage. (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
tolkamps1 authored Jun 14, 2024
1 parent 212b660 commit aafd0d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
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

0 comments on commit aafd0d9

Please sign in to comment.