diff --git a/src/course-outline/data/slice.js b/src/course-outline/data/slice.js index edb8b1e4a5..bd408c958e 100644 --- a/src/course-outline/data/slice.js +++ b/src/course-outline/data/slice.js @@ -121,23 +121,6 @@ const slice = createSlice({ return section; }); }, - deleteUnit: (state, { payload }) => { - state.sectionsList = state.sectionsList.map((section) => { - if (section.id !== payload.sectionId) { - return section; - } - section.childInfo.children = section.childInfo.children.map((subsection) => { - if (subsection.id !== payload.subsectionId) { - return subsection; - } - subsection.childInfo.children = subsection.childInfo.children.filter( - ({ id }) => id !== payload.itemId, - ); - return subsection; - }); - return section; - }); - }, duplicateSection: (state, { payload }) => { state.sectionsList = state.sectionsList.reduce((result, currentValue) => { if (currentValue.id === payload.id) { @@ -166,7 +149,6 @@ export const { setCurrentSubsection, deleteSection, deleteSubsection, - deleteUnit, duplicateSection, reorderSectionList, } = slice.actions; diff --git a/src/course-outline/data/thunk.js b/src/course-outline/data/thunk.js index 81996791e2..50909f5a90 100644 --- a/src/course-outline/data/thunk.js +++ b/src/course-outline/data/thunk.js @@ -39,7 +39,6 @@ import { updateFetchSectionLoadingStatus, deleteSection, deleteSubsection, - deleteUnit, duplicateSection, reorderSectionList, } from './slice'; @@ -265,15 +264,6 @@ export function deleteCourseSubsectionQuery(subsectionId, sectionId) { }; } -export function deleteCourseUnitQuery(unitId, subsectionId, sectionId) { - return async (dispatch) => { - dispatch(deleteCourseItemQuery( - unitId, - () => deleteUnit({ itemId: unitId, subsectionId, sectionId }), - )); - }; -} - /** * Generic function to duplicate any course item. See wrapper functions below for specific implementations. * @param {string} itemId diff --git a/src/course-outline/hooks.jsx b/src/course-outline/hooks.jsx index 1b99460a4a..ec361ce6ce 100644 --- a/src/course-outline/hooks.jsx +++ b/src/course-outline/hooks.jsx @@ -24,7 +24,6 @@ import { addNewSubsectionQuery, deleteCourseSectionQuery, deleteCourseSubsectionQuery, - deleteCourseUnitQuery, editCourseItemQuery, duplicateSectionQuery, duplicateSubsectionQuery, @@ -133,11 +132,7 @@ const useCourseOutline = ({ courseId }) => { dispatch(deleteCourseSubsectionQuery(currentItem.id, currentSection.id)); break; case COURSE_BLOCK_NAMES.vertical.id: - dispatch(deleteCourseUnitQuery( - currentItem.id, - currentSubsection.id, - currentSection.id, - )); + // delete unit break; default: return;