Merge branch 'tutorial' into assessment

This commit is contained in:
Delucse
2020-09-08 11:56:09 +02:00
2 changed files with 47 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
import { TUTORIAL_SUCCESS, TUTORIAL_ERROR, TUTORIAL_CHANGE } from './types';
export const tutorialChange = () => (dispatch) => {
dispatch({
type: TUTORIAL_CHANGE
});
};
export const tutorialCheck = (id, status) => (dispatch, getState) => {
var tutorialsStatus = getState().tutorial.status;
tutorialsStatus[id] = {...tutorialsStatus[id], status: status};
dispatch({
type: status === 'success' ? TUTORIAL_SUCCESS : TUTORIAL_ERROR,
payload: tutorialsStatus
});
dispatch(tutorialChange());
};