Skip to content

Commit 1359938

Browse files
Redirect /challenge/legacyId/submit to /challenge/UUID/submit
1 parent dd90b49 commit 1359938

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/shared/containers/SubmissionPage.jsx

+14
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,19 @@ class SubmissionsPageContainer extends React.Component {
4040
getCommunitiesList(auth);
4141
}
4242

43+
componentWillReceiveProps() {
44+
const {
45+
challenge,
46+
history,
47+
} = this.props;
48+
49+
const { details } = challenge;
50+
51+
if (details && details.isLegacyChallenge && !history.location.pathname.includes(details.id)) {
52+
history.push(`/challenges/${details.id}/submit`, history.state);
53+
}
54+
}
55+
4356
/* A child component has called their submitForm() prop, prepare the passed
4457
form data for submission and create a submit action */
4558
handleSubmit(body) {
@@ -150,6 +163,7 @@ SubmissionsPageContainer.propTypes = {
150163
submissionFilestackData: filestackDataProp.isRequired,
151164
winners: PT.arrayOf(PT.object).isRequired,
152165
loadChallengeDetails: PT.func.isRequired,
166+
history: PT.shape().isRequired,
153167
};
154168

155169
/**

0 commit comments

Comments
 (0)