fixes(frontend): fixed small types/incorrect code
This commit is contained in:
parent
16cac7e111
commit
fac6df3882
5 changed files with 5 additions and 7 deletions
|
|
@ -9,4 +9,4 @@ async function route(_url: string, _args: { [k: string]: string }): Promise<stri
|
|||
|
||||
|
||||
|
||||
addRoute('/', route)
|
||||
addRoute('/about', route)
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue