Skip to content

Commit

Permalink
Merge pull request #1587 from AOT-Technologies/application-resubmit-c…
Browse files Browse the repository at this point in the history
…lentside

Application resubmit leads to 404 in client side issue fixed
  • Loading branch information
abhilash-aot authored Aug 23, 2023
2 parents 6e6e9ae + 53790eb commit 3513f0d
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions forms-flow-web/src/components/Form/Item/Submission/Item/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ const Item = React.memo(() => {
const { formId, submissionId } = useParams();
const dispatch = useDispatch();
const { t } = useTranslation();

const applicationDetail = useSelector(
(state) => state.applications.applicationDetail
);
const applicationId = useSelector(
(state) =>
state[CUSTOM_SUBMISSION_ENABLE ? "customSubmission" : "submission"]?.submission?.data?.applicationId ||
Expand All @@ -45,8 +47,8 @@ const Item = React.memo(() => {

useEffect(() => {
dispatch(clearSubmissionError("submission"));
if(CUSTOM_SUBMISSION_URL && CUSTOM_SUBMISSION_ENABLE) {
dispatch(getCustomSubmission(submissionId,formId));
if (CUSTOM_SUBMISSION_URL && CUSTOM_SUBMISSION_ENABLE) {
dispatch(getCustomSubmission(submissionId, formId));
} else {
dispatch(getSubmission("submission", submissionId, formId));
}
Expand All @@ -65,7 +67,8 @@ const Item = React.memo(() => {
setEditAllowed(true);
} else if (applicationStatus) {
if (getUserRolePermission(userRoles, CLIENT)) {
setEditAllowed(CLIENT_EDIT_STATUS.includes(applicationStatus));
setEditAllowed(CLIENT_EDIT_STATUS.includes(applicationStatus)
|| applicationDetail.isResubmit ? true : false);
setShowSubmissionLoading(false);
}
}
Expand Down Expand Up @@ -100,15 +103,15 @@ const Item = React.memo(() => {
</ul>
<Switch>
{!submissionError ? (
<Route
exact
path={`${BASE_ROUTE}form/:formId/submission/:submissionId`}
component={View}
/>
<Route
exact
path={`${BASE_ROUTE}form/:formId/submission/:submissionId`}
component={View}
/>
) : <NotFound
errorMessage={t("Bad Request")}
errorCode={400}
/> }
errorMessage={t("Bad Request")}
errorCode={400}
/>}
<Redirect
exact
from={`${BASE_ROUTE}form/:formId/submission/:submissionId/edit/:notavailable`}
Expand Down

0 comments on commit 3513f0d

Please sign in to comment.