From b490f802a83382ad1a255cfef47724a0e7a9789b Mon Sep 17 00:00:00 2001 From: Lia Lenckowski Date: Thu, 17 Aug 2023 19:26:17 +0200 Subject: error handling for login; partial adminpanel infrastructure --- frontend/helper.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'frontend/helper.ts') diff --git a/frontend/helper.ts b/frontend/helper.ts index 879d322..827a204 100644 --- a/frontend/helper.ts +++ b/frontend/helper.ts @@ -11,14 +11,14 @@ interface Opts { href?: string, method?: string, placeholder?: string, - onclick?: (e: E) => void, - onchange?: (e: E) => void, + onclick?: (e: Event) => void, + onchange?: (e: Event) => void, } function apply_opts(e: E, o: Opts) { if (o.id) e.id = o.id - if (o.onclick) e.onclick = () => o.onclick!(e) - if (o.onchange) e.onchange = () => o.onchange!(e) + if (o.onclick) e.onclick = ev => o.onclick!(ev) + if (o.onchange) e.onchange = ev => o.onchange!(ev) // TODO can we do this properly? if (o.for) (e as unknown as HTMLLabelElement).htmlFor = o.for if (o.type && (e instanceof HTMLInputElement || e instanceof HTMLLinkElement)) e.type = o.type -- cgit v1.2.3-70-g09d2