This commit is contained in:
2025-08-19 18:04:13 +05:45
parent 93d2016ef1
commit f422cba1ac

View File

@@ -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);