import { apiFetch } from "./config";

export const checkDomainAvailability = async (domain) => {
  return await apiFetch("/api/check-domain", {
    method: "POST",
    body: JSON.stringify({ domain }),
  });
};

export const registerDomain = async (domain, local_part, name, password) => {
  return await apiFetch("/api/register", {
    method: "POST",
    body: JSON.stringify({
      domain,
      local_part,
      name,
      password,
    }),
  });
};

export const getExportZone = async (domain) => {
  return await apiFetch(`/api/export-zone?domain=${encodeURIComponent(domain)}`);
};
