/*
 *
 * Edit actions
 *
 */
import * as types from './constants';

export function defaultAction() {
  return {
    type: types.DEFAULT_ACTION,
  };
}

export function editTemplate(template, onUpdateTemplateComplete) {
  return {
    type: types.EDIT_TEMPLATE_REQUEST,
    template,
    onUpdateTemplateComplete,
  };
}

export function getTemplateDetails(id) {
  return {
    type: types.GET_TEMPLATE_DETAILS_REQUEST, id,
  };
}

export function setTemplateDetails(templateDetails) {
  return {
    type: types.GET_TEMPLATE_DETAILS_SUCCESS,
    data: templateDetails,
  };
}

export function clearEditResponse() {
  return {
    type: types.CLEAR_EDIT_RESPONSE_REQUEST,
  };
}

export function resetEditTemplate() {
  return {
    type: types.RESET_EDIT_TEMPLATE,
  };
}
