@omegabigdata/honoplay-redux-helper
Version:
honoplay-redux-helper
61 lines (52 loc) • 1.91 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.fetchQuestionDifficulty = exports.fetchQuestionDifficultyList = void 0;
var _QuestionDifficulty = require("../helpers/ActionTypes/QuestionDifficulty");
var _honoplayApiHelperNode = require("@omegabigdata/honoplay-api-helper-node");
var fetchQuestionDifficultyList = function fetchQuestionDifficultyList() {
var skip = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
var take = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
return function (dispatch) {
dispatch({
type: _QuestionDifficulty.FETCHING_QUESTION_DIFFICULTY_LIST
});
_honoplayApiHelperNode.QuestionDifficulty.getQuestionDifficulties(skip, take, function (success) {
dispatch({
type: _QuestionDifficulty.FETCH_QUESTION_DIFFICULTY_LIST_SUCCESS,
data: success.data
});
}, function (error) {
dispatch({
type: _QuestionDifficulty.FETCH_QUESTION_DIFFICULTY_LIST_FAILED,
data: {
error: error
}
});
});
};
};
exports.fetchQuestionDifficultyList = fetchQuestionDifficultyList;
var fetchQuestionDifficulty = function fetchQuestionDifficulty(questionDifficultyId) {
return function (dispatch) {
dispatch({
type: _QuestionDifficulty.FETCHING_QUESTION_DIFFICULTY
});
_honoplayApiHelperNode.QuestionDifficulty.getQuestionDifficulty(questionDifficultyId, function (success) {
dispatch({
type: _QuestionDifficulty.FETCH_QUESTION_DIFFICULTY_SUCCESS,
data: success.data
});
}, function (error) {
dispatch({
type: _QuestionDifficulty.FETCH_QUESTION_DIFFICULTY_FAILED,
data: {
error: error
}
});
});
};
};
exports.fetchQuestionDifficulty = fetchQuestionDifficulty;
//# sourceMappingURL=QuestionDifficulty.js.map