import axios from "axios";
import Configuration from "../Configuration";
import { getAjaxActionUrl } from "../utils";

export const apiSendSupport = (data, callback) => {
  console.log('API: send support...')
  if (Configuration.getInstance().is_debug) {
    callback('This is callback from debug')
    console.log(data)
    return
  }
  const requestUrl = getAjaxActionUrl('send_support');
  const ajax = axios.post(requestUrl, {
    data: data,
  })
  if (callback) {
    ajax.then(response => callback(response));
  }
}