From 30a4ca17ac7fad83dd95e967857bc8401188b4d4 Mon Sep 17 00:00:00 2001 From: Jansen Kantor Date: Fri, 10 Jan 2025 14:07:01 -0500 Subject: [PATCH 1/2] fix: error code expecting wrong data shape --- src/data/redux/grading/reducer.js | 6 +++--- src/data/redux/grading/reducer.test.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/data/redux/grading/reducer.js b/src/data/redux/grading/reducer.js index ee5ff0f5..8c01cf41 100644 --- a/src/data/redux/grading/reducer.js +++ b/src/data/redux/grading/reducer.js @@ -182,11 +182,11 @@ const grading = createSlice({ const gradeData = { ...state.gradeData, - ...(payload && { [submissionUUID]: payload.submissionStatus.gradeData }), + ...(payload && { [submissionUUID]: payload.gradeData }), }; - const { gradeStatus } = payload ? payload.submissionStatus : state.current; - const lockStatus = payload ? payload.submissionStatus.lockStatus : lockStatuses.unlocked; + const { gradeStatus } = payload ? payload : state.current; + const lockStatus = payload ? payload.lockStatus : lockStatuses.unlocked; return { ...state, diff --git a/src/data/redux/grading/reducer.test.js b/src/data/redux/grading/reducer.test.js index 254aeae5..89cd90b4 100644 --- a/src/data/redux/grading/reducer.test.js +++ b/src/data/redux/grading/reducer.test.js @@ -250,7 +250,7 @@ describe('app reducer', () => { }); describe('stopGrading', () => { let output; - const args = { submissionStatus: { gradeData: testData, lockStatus, gradeStatus } }; + const args = { gradeData: testData, lockStatus, gradeStatus }; describe('resulting state', () => { test('gradingData: deletes current data', () => { output = reducer(testState, actions.stopGrading()); From ca8d08c8a0b85c0f3630d9610ba719ace50d5a9b Mon Sep 17 00:00:00 2001 From: Jansen Kantor Date: Fri, 10 Jan 2025 14:08:32 -0500 Subject: [PATCH 2/2] fixup! fix: error code expecting wrong data shape --- src/data/redux/grading/reducer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/redux/grading/reducer.js b/src/data/redux/grading/reducer.js index 8c01cf41..0b22f777 100644 --- a/src/data/redux/grading/reducer.js +++ b/src/data/redux/grading/reducer.js @@ -185,7 +185,7 @@ const grading = createSlice({ ...(payload && { [submissionUUID]: payload.gradeData }), }; - const { gradeStatus } = payload ? payload : state.current; + const { gradeStatus } = payload || state.current; const lockStatus = payload ? payload.lockStatus : lockStatuses.unlocked; return {