Skip to content

Commit 7aee856

Browse files
authored
Merge pull request #390 from openedx/jkantor/conflictError
fix: error code expecting wrong data shape
2 parents f87d521 + ebca59a commit 7aee856

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/data/redux/grading/reducer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,11 @@ const grading = createSlice({
182182

183183
const gradeData = {
184184
...state.gradeData,
185-
...(payload && { [submissionUUID]: payload.submissionStatus.gradeData }),
185+
...(payload && { [submissionUUID]: payload.gradeData }),
186186
};
187187

188-
const { gradeStatus } = payload ? payload.submissionStatus : state.current;
189-
const lockStatus = payload ? payload.submissionStatus.lockStatus : lockStatuses.unlocked;
188+
const { gradeStatus } = payload || state.current;
189+
const lockStatus = payload ? payload.lockStatus : lockStatuses.unlocked;
190190

191191
return {
192192
...state,

src/data/redux/grading/reducer.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ describe('app reducer', () => {
250250
});
251251
describe('stopGrading', () => {
252252
let output;
253-
const args = { submissionStatus: { gradeData: testData, lockStatus, gradeStatus } };
253+
const args = { gradeData: testData, lockStatus, gradeStatus };
254254
describe('resulting state', () => {
255255
test('gradingData: deletes current data', () => {
256256
output = reducer(testState, actions.stopGrading());

0 commit comments

Comments
 (0)