fix: backend projects not submitting (#38900)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
@ -13,7 +13,6 @@ import {
|
||||
consoleOutputSelector,
|
||||
initConsole,
|
||||
initTests,
|
||||
updateBackendFormValues,
|
||||
updateChallengeMeta,
|
||||
updateSolutionFormValues
|
||||
} from '../../redux';
|
||||
@ -53,7 +52,6 @@ const propTypes = {
|
||||
}),
|
||||
tests: PropTypes.array,
|
||||
title: PropTypes.string,
|
||||
updateBackendFormValues: PropTypes.func.isRequired,
|
||||
updateChallengeMeta: PropTypes.func.isRequired,
|
||||
updateSolutionFormValues: PropTypes.func.isRequired
|
||||
};
|
||||
@ -74,7 +72,6 @@ const mapDispatchToActions = {
|
||||
executeChallenge,
|
||||
initConsole,
|
||||
initTests,
|
||||
updateBackendFormValues,
|
||||
updateChallengeMeta,
|
||||
updateSolutionFormValues
|
||||
};
|
||||
@ -155,7 +152,7 @@ export class BackEnd extends Component {
|
||||
},
|
||||
tests,
|
||||
executeChallenge,
|
||||
updateBackendFormValues
|
||||
updateSolutionFormValues
|
||||
} = this.props;
|
||||
|
||||
const blockNameTitle = `${blockName} - ${title}`;
|
||||
@ -181,7 +178,7 @@ export class BackEnd extends Component {
|
||||
<SolutionForm
|
||||
challengeType={challengeType}
|
||||
onSubmit={executeChallenge}
|
||||
updateSolutionForm={updateBackendFormValues}
|
||||
updateSolutionForm={updateSolutionFormValues}
|
||||
/>
|
||||
<ProjectToolPanel
|
||||
guideUrl={getGuideUrl({ forumTopicId, title })}
|
||||
|
@ -11,7 +11,6 @@ import { ofType } from 'redux-observable';
|
||||
import { navigate } from 'gatsby';
|
||||
|
||||
import {
|
||||
backendFormValuesSelector,
|
||||
projectFormValuesSelector,
|
||||
types,
|
||||
challengeMetaSelector,
|
||||
@ -108,7 +107,7 @@ function submitBackendChallenge(type, state) {
|
||||
const { username } = userSelector(state);
|
||||
const {
|
||||
solution: { value: solution }
|
||||
} = backendFormValuesSelector(state);
|
||||
} = projectFormValuesSelector(state);
|
||||
const challengeInfo = { id, solution };
|
||||
|
||||
const update = {
|
||||
|
@ -52,7 +52,6 @@ export const types = createTypes(
|
||||
'initTests',
|
||||
'initConsole',
|
||||
'initLogs',
|
||||
'updateBackendFormValues',
|
||||
'updateConsole',
|
||||
'updateChallengeMeta',
|
||||
'updateFile',
|
||||
@ -128,9 +127,6 @@ export const cancelTests = createAction(types.cancelTests);
|
||||
|
||||
export const initConsole = createAction(types.initConsole);
|
||||
export const initLogs = createAction(types.initLogs);
|
||||
export const updateBackendFormValues = createAction(
|
||||
types.updateBackendFormValues
|
||||
);
|
||||
export const updateChallengeMeta = createAction(types.updateChallengeMeta);
|
||||
export const updateFile = createAction(types.updateFile);
|
||||
export const updateConsole = createAction(types.updateConsole);
|
||||
@ -190,8 +186,6 @@ export const isResetModalOpenSelector = state => state[ns].modal.reset;
|
||||
export const isBuildEnabledSelector = state => state[ns].isBuildEnabled;
|
||||
export const successMessageSelector = state => state[ns].successMessage;
|
||||
|
||||
export const backendFormValuesSelector = state =>
|
||||
state[ns].backendFormValues || {};
|
||||
export const projectFormValuesSelector = state =>
|
||||
state[ns].projectFormValues || {};
|
||||
|
||||
@ -207,7 +201,7 @@ export const challengeDataSelector = state => {
|
||||
files: challengeFilesSelector(state)
|
||||
};
|
||||
} else if (challengeType === challengeTypes.backend) {
|
||||
const { solution: url = {} } = backendFormValuesSelector(state);
|
||||
const { solution: url = {} } = projectFormValuesSelector(state);
|
||||
challengeData = {
|
||||
...challengeData,
|
||||
url
|
||||
@ -329,10 +323,6 @@ export const reducer = handleActions(
|
||||
})),
|
||||
consoleOut: ''
|
||||
}),
|
||||
[types.updateBackendFormValues]: (state, { payload }) => ({
|
||||
...state,
|
||||
backendFormValues: payload
|
||||
}),
|
||||
[types.updateSolutionFormValues]: (state, { payload }) => ({
|
||||
...state,
|
||||
projectFormValues: payload
|
||||
|
Reference in New Issue
Block a user