/*
 *
 * Create actions
 *
 */


import * as types from "./constants";

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

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

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

export function getIosCtas(licenseCode) {
  return {
    type: types.GET_IOS_CTAS, licenseCode,
  };
}

export function uploadAsset(file, assetType, fileParams, mode) {
  return {
    type: types.UPLOAD_ASSET_REQUEST,
    file,
    assetType,
    fileParams,
    mode,
  };
}
export function clearEditResponse() {
  return {
    type: types.CLEAR_EDIT_RESPONSE_REQUEST,
  };
}

export function clearData() {
  return {
    type: types.CLEAR_DATA,
  };
}

export function clearAsset() {
  return {
    type: types.CLEAR_ASSET,
  };
}

export function getWeCrmAccounts(source) {
  return {
    type: types.GET_WECRM_ACCOUNTS_REQUEST, source,
  };
}

export function setWeChatAccount(weChatAccount) {
  return {
    type: types.SET_WECHAT_ACCOUNT,
    weChatAccount,
  };
}

export function getMobilepushTemplatesList(channel, queryParams) {
  return {
    type: types.GET_MOBILEPUSH_TEMPLATES_LIST_REQUEST,
    channel,
    queryParams,
  };
}

export function setSelectedTemplate(templateData) {
  return {
    type: types.SET_SELECTED_TEMPLATE,
    data: templateData,
  };
}

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