fixes(frontend): fixed small types/incorrect code

This commit is contained in:
Maieul BOYER 2025-11-10 19:16:15 +01:00 committed by Maix0
parent 16cac7e111
commit fac6df3882
5 changed files with 5 additions and 7 deletions

View file

@ -9,4 +9,4 @@ async function route(_url: string, _args: { [k: string]: string }): Promise<stri
addRoute('/', route)
addRoute('/about', route)

View file

@ -20,10 +20,9 @@ function handleLogin(_url: string, _args: RouteHandlerParams): RouteHandlerRetur
const fLogin = document.querySelector<HTMLFormElement>('form#login-form');
if (fLogin === null)
return showError('Error while rendering the page: no form found');
showSuccess('got the form !')
fLogin.addEventListener('submit', async function(e: SubmitEvent) {
e.preventDefault();
let form = e.target as (HTMLFormElement | null)
let form = e.target as (HTMLFormElement | null);
if (form === null)
return showError('Failed to send form...');
let formData = Object.fromEntries((new FormData(form)).entries());