/*
 *
 * WeChat actions
 *
 */

import * as types from './constants';

export function getDefaultWeChatTemplates(channel, queryParams) {
  return {
    type: types.GET_WECHAT_DEFAULT_TEMPLATES_REQUEST,
    channel,
    queryParams,
  };
}
export function createTemplate(template, callback) {
  return {
    type: types.CREATE_TEMPLATE_REQUEST,
    template,
    callback,
  };
}

export function clearCreateResponse() {
  return {
    type: types.CLEAR_CREATE_RESPONSE_REQUEST,
  };
}

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

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

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,
  };
}
