From d8637f9464b577a38b4aa730286b7486ba7b84df Mon Sep 17 00:00:00 2001 From: Ben Warzeski Date: Thu, 8 Sep 2022 23:22:03 -0400 Subject: [PATCH] feat: unenroll thunk action --- src/data/redux/thunkActions/app.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/data/redux/thunkActions/app.js b/src/data/redux/thunkActions/app.js index 550d12a..8452a50 100644 --- a/src/data/redux/thunkActions/app.js +++ b/src/data/redux/thunkActions/app.js @@ -7,7 +7,7 @@ import requests from './requests'; // import { locationId } from 'data/constants/app'; // import { } from './requests'; -// import * as module from './app'; +import * as module from './app'; /** * initialize the app, loading ora and course metadata from the api, and loading the initial @@ -47,9 +47,14 @@ export const updateEntitlementSession = (cardId, selection) => (dispatch, getSta }); }; +export const unenroll = (courseId) => (dispatch, getState) => post( + selectors.app.courseCard.courseRun(getState(), courseId), +).then(() => dispatch(module.refreshList())); + export default StrictDict({ initialize, refreshList, sendConfirmEmail, updateEntitlementSession, + unenroll, });