UNPKG

trc-client-core

Version:
29 lines (27 loc) 989 B
import xhr from 'trc-client-core/src/utils/xhr'; import reflux from 'reflux'; import ImmutableStoreMixin from 'reflux-immutable/ImmutableStoreMixin'; import UserStore from 'trc-client-core/src/user/UserStore'; var PathwayStore = reflux.createStore({ mixins: [ImmutableStoreMixin], init: function () { this.setState({ learningPlans: UserStore.get('learningPlans') }); }, pathways: { get: function (query) { return xhr.get('/api/portal/profile/view', query); } }, productPathway: function (query) { return xhr.get('/api/product/plan/segment', query); }, startCourse: function (query) { return xhr.get(`/learning/participant/${query.participantId}/course/${query.courseCode}/start`); }, startComplete: function (query) { return xhr.get(`/learning/participant/${query.participantId}/course/${query.courseCode}/start_then_complete`); } }); export default PathwayStore;