fix(js): memperbaiki logika send form untuk reset-password

This commit is contained in:
Yoga Pangestu 2024-11-24 16:10:46 +07:00
parent 1f50093097
commit 3c3babe053

View File

@ -19,7 +19,10 @@ $(document).ready(function () {
$(document).on("click", ".reset-password", function (e) {
e.preventDefault();
const url = $(this).attr('href');
const form = $(this).closest("form");
if (!form.length) {
return;
}
Swal.fire({
title: 'Permohonan Reset Kata Sandi',
@ -30,7 +33,7 @@ $(document).ready(function () {
cancelButtonText: 'Batal'
}).then(function (result) {
if (result.isConfirmed) {
window.location.href = url;
form[0].submit();
}
});
});