diff --git a/mamutes/Users/__pycache__/__init__.cpython-312.pyc b/mamutes/Users/__pycache__/__init__.cpython-312.pyc index a69dd06..df16278 100644 Binary files a/mamutes/Users/__pycache__/__init__.cpython-312.pyc and b/mamutes/Users/__pycache__/__init__.cpython-312.pyc differ diff --git a/mamutes/Users/__pycache__/admin.cpython-312.pyc b/mamutes/Users/__pycache__/admin.cpython-312.pyc index 65e18ac..39e0a0e 100644 Binary files a/mamutes/Users/__pycache__/admin.cpython-312.pyc and b/mamutes/Users/__pycache__/admin.cpython-312.pyc differ diff --git a/mamutes/Users/__pycache__/apps.cpython-312.pyc b/mamutes/Users/__pycache__/apps.cpython-312.pyc index ff50487..b6e35df 100644 Binary files a/mamutes/Users/__pycache__/apps.cpython-312.pyc and b/mamutes/Users/__pycache__/apps.cpython-312.pyc differ diff --git a/mamutes/Users/__pycache__/forms.cpython-312.pyc b/mamutes/Users/__pycache__/forms.cpython-312.pyc index 900e690..b72af95 100644 Binary files a/mamutes/Users/__pycache__/forms.cpython-312.pyc and b/mamutes/Users/__pycache__/forms.cpython-312.pyc differ diff --git a/mamutes/Users/__pycache__/models.cpython-312.pyc b/mamutes/Users/__pycache__/models.cpython-312.pyc index 0bf6828..24f5df8 100644 Binary files a/mamutes/Users/__pycache__/models.cpython-312.pyc and b/mamutes/Users/__pycache__/models.cpython-312.pyc differ diff --git a/mamutes/Users/__pycache__/views.cpython-312.pyc b/mamutes/Users/__pycache__/views.cpython-312.pyc index 49edb0b..0c559c3 100644 Binary files a/mamutes/Users/__pycache__/views.cpython-312.pyc and b/mamutes/Users/__pycache__/views.cpython-312.pyc differ diff --git a/mamutes/Users/static/scripts/openModal.js b/mamutes/Users/static/scripts/openModal.js index bc54af4..7b994f0 100644 --- a/mamutes/Users/static/scripts/openModal.js +++ b/mamutes/Users/static/scripts/openModal.js @@ -2,11 +2,32 @@ const btnModal = document.querySelector('#btnModal'); const modal = document.querySelector('#modal'); const btnClose = document.querySelector('#btnClose'); + const form = document.querySelector('#recoverAccountForm'); + const mensagemContainer = document.querySelector('#mensagemContainer'); btnModal.addEventListener("click", ()=>{ modal.showModal(); }); btnClose.addEventListener("click", ()=>{ modal.close(); - }) -})() \ No newline at end of file + }); + + form.addEventListener("submit", (event) => { + event.preventDefault(); + const formData = new FormData(form); + fetch(form.action, { + method: 'POST', + body: formData, + headers: { + 'X-Requested-With': 'XMLHttpRequest', + }, + }) + .then(response => response.json()) + .then(data => { + mensagemContainer.textContent = data.mensagem; + if (data.success) { + form.reset(); + } + }) + }); +})(); \ No newline at end of file diff --git a/mamutes/Users/templates/recoverAccount.html b/mamutes/Users/templates/recoverAccount.html index 29f7b73..22f2491 100644 --- a/mamutes/Users/templates/recoverAccount.html +++ b/mamutes/Users/templates/recoverAccount.html @@ -14,15 +14,13 @@