From a17b7a564e18ebc9c152b0939d4ea89a25d1ae1e Mon Sep 17 00:00:00 2001 From: dominicbachmann Date: Wed, 6 Apr 2022 21:49:43 +0200 Subject: [PATCH] Added types for form --- src/lib/form.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/form.ts b/src/lib/form.ts index 08099576d..5a7d65e23 100644 --- a/src/lib/form.ts +++ b/src/lib/form.ts @@ -1,5 +1,6 @@ import { toast } from '@zerodevx/svelte-toast'; -export function errorNotification(message: string) { + +export function errorNotification(message: string): void { console.error(message); if (typeof message !== 'string') { toast.push('Ooops, something is not okay, are you okay?'); @@ -30,7 +31,7 @@ export function enhance( e.preventDefault(); let body = new FormData(form); - let parsedData = body; + const parsedData = body; body.forEach((data, key) => { if (data === '' || data === null) parsedData.delete(key);