Added types for form
This commit is contained in:
parent
de37ee9f1c
commit
a17b7a564e
@ -1,5 +1,6 @@
|
|||||||
import { toast } from '@zerodevx/svelte-toast';
|
import { toast } from '@zerodevx/svelte-toast';
|
||||||
export function errorNotification(message: string) {
|
|
||||||
|
export function errorNotification(message: string): void {
|
||||||
console.error(message);
|
console.error(message);
|
||||||
if (typeof message !== 'string') {
|
if (typeof message !== 'string') {
|
||||||
toast.push('Ooops, something is not okay, are you okay?');
|
toast.push('Ooops, something is not okay, are you okay?');
|
||||||
@ -30,7 +31,7 @@ export function enhance(
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
let body = new FormData(form);
|
let body = new FormData(form);
|
||||||
let parsedData = body;
|
const parsedData = body;
|
||||||
|
|
||||||
body.forEach((data, key) => {
|
body.forEach((data, key) => {
|
||||||
if (data === '' || data === null) parsedData.delete(key);
|
if (data === '' || data === null) parsedData.delete(key);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user