UNPKG

@omegabigdata/honoplay-redux-helper

Version:
61 lines (52 loc) 1.73 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fetchQuestionType = exports.fetchQuestionTypeList = void 0; var _QuestionType = require("../helpers/ActionTypes/QuestionType"); var _honoplayApiHelperNode = require("@omegabigdata/honoplay-api-helper-node"); var fetchQuestionTypeList = function fetchQuestionTypeList() { 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: _QuestionType.FETCHING_QUESTION_TYPE_LIST }); _honoplayApiHelperNode.QuestionType.getQuestionTypes(skip, take, function (success) { dispatch({ type: _QuestionType.FETCH_QUESTION_TYPE_LIST_SUCCESS, data: success.data }); }, function (error) { dispatch({ type: _QuestionType.FETCH_QUESTION_TYPE_LIST_FAILED, data: { error: error } }); }); }; }; exports.fetchQuestionTypeList = fetchQuestionTypeList; var fetchQuestionType = function fetchQuestionType(questionTypeId) { return function (dispatch) { dispatch({ type: _QuestionType.FETCHING_QUESTION_TYPE }); _honoplayApiHelperNode.QuestionType.getQuestionType(questionTypeId, function (success) { dispatch({ type: _QuestionType.FETCH_QUESTION_TYPE_SUCCESS, data: success.data }); }, function (error) { dispatch({ type: _QuestionType.FETCH_QUESTION_TYPE_FAILED, data: { error: error } }); }); }; }; exports.fetchQuestionType = fetchQuestionType; //# sourceMappingURL=QuestionType.js.map