File tree Expand file tree Collapse file tree 4 files changed +11
-3
lines changed
src/containers/UnenrollConfirmModal/hooks Expand file tree Collapse file tree 4 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,6 @@ CAREER_LINK_URL=''
4242ENABLE_EDX_PERSONAL_DASHBOARD = false
4343ENABLE_PROGRAMS = false
4444NON_BROWSABLE_COURSES = false
45- SHOW_UNENROLL_SURVEY = false
45+ SHOW_UNENROLL_SURVEY = true
4646# Fallback in local style files
4747PARAGON_THEME_URLS = {}
Original file line number Diff line number Diff line change @@ -48,6 +48,6 @@ CAREER_LINK_URL=''
4848ENABLE_EDX_PERSONAL_DASHBOARD = false
4949ENABLE_PROGRAMS = false
5050NON_BROWSABLE_COURSES = false
51- SHOW_UNENROLL_SURVEY = false
51+ SHOW_UNENROLL_SURVEY = true
5252# Fallback in local style files
5353PARAGON_THEME_URLS = {}
Original file line number Diff line number Diff line change @@ -21,10 +21,18 @@ export const modalStates = StrictDict({
2121
2222export const useUnenrollData = ( { closeModal, cardId } ) => {
2323 const [ isConfirmed , setIsConfirmed ] = module . state . confirmed ( false ) ;
24- const confirm = ( ) => setIsConfirmed ( true ) ;
2524 const reason = useUnenrollReasons ( { cardId } ) ;
2625 const refreshList = apiHooks . useInitializeApp ( ) ;
2726
27+ const unenrollFromCourse = apiHooks . useUnenrollFromCourse ( cardId ) ;
28+
29+ const confirm = ( ) => {
30+ if ( ! configuration . SHOW_UNENROLL_SURVEY ) {
31+ unenrollFromCourse ( ) ;
32+ }
33+ setIsConfirmed ( true ) ;
34+ } ;
35+
2836 let modalState ;
2937 if ( isConfirmed ) {
3038 modalState = ( reason . isSubmitted || ! configuration . SHOW_UNENROLL_SURVEY )
You can’t perform that action at this time.
0 commit comments