'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getQuizSessionEvents = getQuizSessionEvents;

var _Fetcher = require('../../common/util/Fetcher');

var _Fetcher2 = _interopRequireDefault(_Fetcher);

var _withDynamoPagination = require('../../common/util/withDynamoPagination');

var _withDynamoPagination2 = _interopRequireDefault(_withDynamoPagination);

var _callHandlers = require('../../common/api/callHandlers');

var _constants = require('../../constants');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function getQuizSessionEvents(quizSessionId) {
  var url = '/api/quiz_sessions/' + quizSessionId + '/quiz_session_events';
  var fetcher = Reflect.construct((0, _withDynamoPagination2.default)(_Fetcher2.default), [{ callType: _constants.QUIZ_SESSION_EVENTS_FETCH_CALL }]);

  return function (dispatch, getState) {
    return fetcher.paginatedGet(url, {
      actionCreator: _callHandlers.handleQuizSessionEventsResponse
    });
  };
}