Fix messages in mail

This commit is contained in:
2024-01-26 20:42:52 +01:00
parent dec5d82187
commit 5c6f2dd117

View File

@@ -19,11 +19,11 @@ const schema = yup.object().shape({
function onSubmit(data) { const onSubmit = async (data) => {
console.log("DATA=", data); console.log("DATA=", data);
try { try {
const response = axios.post(route("ajax.send.email"), { const response = await axios.post(route("ajax.send.email"), {
name: data.name, name: data.name,
email: data.email, email: data.email,
subject: data.subject, subject: data.subject,
@@ -33,15 +33,8 @@ function onSubmit(data) {
console.log("TEST=", response.data); console.log("TEST=", response.data);
result.value = response.data; result.value = response.data;
} catch (e) { } catch (e) {
const response = Swal.fire({ console.log('TEST=',`${e}`);
title: __("are you want to try again") + "?", result.value = { 'error': `${e}`};
text: __(`${e}`),
icon: "question",
showCancelButton: true,
showCloseButton: true,
});
response.isConfirmed && fetch();
} }
}; };