diff --git a/client/src/client-only-routes/show-project-links.tsx b/client/src/client-only-routes/show-project-links.tsx index 279ee5b99c..39e775e36a 100644 --- a/client/src/client-only-routes/show-project-links.tsx +++ b/client/src/client-only-routes/show-project-links.tsx @@ -65,6 +65,7 @@ const ShowProjectLinks = (props: ShowProjectLinksProps): JSX.Element => { return ( ); diff --git a/client/src/redux/settings/settings-sagas.js b/client/src/redux/settings/settings-sagas.js index 73b5ce5e44..00bf9dc895 100644 --- a/client/src/redux/settings/settings-sagas.js +++ b/client/src/redux/settings/settings-sagas.js @@ -1,3 +1,4 @@ +import { omit } from 'lodash-es'; import { call, delay, put, takeLatest, takeEvery } from 'redux-saga/effects'; import { createFlashMessage } from '../../components/Flash/redux'; @@ -85,7 +86,13 @@ function* verifyCertificationSaga({ payload }) { yield put( verifyCertComplete({ ...response, - payload: { ...isCertMap, completedChallenges } + payload: { + ...isCertMap, + completedChallenges: completedChallenges.map(x => ({ + ...omit(x, 'files'), + challengeFiles: x.files ?? null + })) + } }) ); yield put(createFlashMessage(response)); diff --git a/client/src/templates/Challenges/redux/completion-epic.js b/client/src/templates/Challenges/redux/completion-epic.js index 808e4ef2cd..6665932052 100644 --- a/client/src/templates/Challenges/redux/completion-epic.js +++ b/client/src/templates/Challenges/redux/completion-epic.js @@ -1,4 +1,5 @@ import { navigate } from 'gatsby'; +import { omit } from 'lodash-es'; import { ofType } from 'redux-observable'; import { of, empty } from 'rxjs'; import { @@ -35,16 +36,20 @@ import { function postChallenge(update, username) { const saveChallenge = postUpdate$(update).pipe( retry(3), - switchMap(({ points }) => - of( + switchMap(({ points }) => { + const payloadWithClientProperties = { + ...omit(update.payload, ['files']), + challengeFiles: update.payload.files ?? null + }; + return of( submitComplete({ username, points, - ...update.payload + ...payloadWithClientProperties }), updateComplete() - ) - ), + ); + }), catchError(() => of(updateFailed(update))) ); return saveChallenge;