import {genericWebAPICall} from 'utils/AppAPI';
import * as constants from 'constants/TerminalConstants';

//action is called when the user types login credentials

//action is called when the user updates input for submitting
// function setSubmittedInput(response){
// 		return {
// 			type: constants.SET_SUBMITTEDINPUT,
// 			response : response
// 		};
// }

// function setCurrentLevel(response){
// 		return {
// 			type: constants.SET_CURRENT_LEVEL,
// 			response : response
// 		};
// }

// function incorrectSubmission(response){
// 		return {
// 			type: constants.INCORRECT_SUBMISSSION,
// 			response : response
// 		};
// }
// function submitClicked(response){
// 		return {
// 			type: constants.SUBMIT_CLICKED,
// 			response : response
// 		};
// }
// function setLevelCleared(response){
// 		return {
// 			type: constants.SET_LEVEL_CLEARED,
// 			response : response
// 		};
// }

function getTerminalData (response) {
  return {
    type: constants.GET_TERMINAL_DATA,
    response:response
  }
}

function getVLQDetailsAPI (vlqObject) {
  return dispatch => {
    const requestedObject = vlqObject;
    genericWebAPICall(
      'vlabs/getVLQDetailsAPI/v1/',
      requestedObject,
      function (response) {
        console.log('Success @getVLQDetails response >> ',response);
        dispatch(getTerminalData(response));
      },
      function (response) {
        console.log('ERROR @getVLQDetails response >> ', response);
      }
    );
  }
}
export const TerminalActions = { 
	// setSubmittedInput,
	// setCurrentLevel,
	// incorrectSubmission,
	// submitClicked,
	// setLevelCleared
  // getVLQDetailsAPI
};
