function login() {
  const email = document.getElementById("emailInput");
  const password = document.getElementById("passwordInput");

  const emailValue = email.value;
  const passwordValue = password.value;
  axios
    .post("https://api.sanabel-altatweer.com/user/login", {
      email: email.value,
      password: password.value,
    })
    .then(function (response) {
      const token = response.data.token;
      console.log(token);
      document.cookie = `token=${token}; expires=Thu, 18 Dec 2026 12:00:00 UTC; path=/`;
      window.location.href = "../../../html/inquiries.html";
    })
    .catch(function (response) {
      Swal.fire({
        icon: "error",
        title: "خطأ فى تسجيل الدخول!",
        text: "الاسم او كلمة المرور خطأ.",
        confirmButtonColor: "#db792e",
      });
    });
}
function logout() {
  document.cookie = `token=; expires=Thu, 18 Dec 2013 12:00:00 UTC; path=/`;
  window.location.href = "../../../login.html";
}
