changes
This commit is contained in:
@@ -202,11 +202,12 @@
|
|||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
form.reset();
|
form.reset();
|
||||||
toastr.success(data.message || 'Contact Submitted successful!');
|
window.location.href =
|
||||||
|
"{{ route('thankyou') }}"; // ✅ redirect instead of toastr
|
||||||
} else if (data.errors && data.errors.email) {
|
} else if (data.errors && data.errors.email) {
|
||||||
data.errors.email.forEach(msg => toastr.error(msg));
|
data.errors.email.forEach(msg => toastr.error(msg));
|
||||||
} else {
|
} else {
|
||||||
toastr.error('Submittion failed. Please try again.');
|
toastr.error('Submission failed. Please try again.');
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
@@ -241,11 +242,12 @@
|
|||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
form.reset();
|
form.reset();
|
||||||
toastr.success(data.message || 'Contact Submitted successful!');
|
window.location.href =
|
||||||
|
"{{ route('thankyou') }}"; // ✅ redirect instead of toastr
|
||||||
} else if (data.errors && data.errors.email) {
|
} else if (data.errors && data.errors.email) {
|
||||||
data.errors.email.forEach(msg => toastr.error(msg));
|
data.errors.email.forEach(msg => toastr.error(msg));
|
||||||
} else {
|
} else {
|
||||||
toastr.error('Submittion failed. Please try again.');
|
toastr.error('Submission failed. Please try again.');
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
Reference in New Issue
Block a user