From cbebedd51e1b4a2f709341b792dd073bac83f15d Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Fri, 12 May 2023 23:01:55 -0600 Subject: Añadido formulario de edición de cuenta MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/form_utils.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/lib/form_utils.ts (limited to 'src/lib/form_utils.ts') diff --git a/src/lib/form_utils.ts b/src/lib/form_utils.ts new file mode 100644 index 0000000..a4e7bff --- /dev/null +++ b/src/lib/form_utils.ts @@ -0,0 +1,10 @@ +export function deleteEmptyFields(form: FormData) { + const trimmed_form = form; + + for(const key of trimmed_form) { + if(trimmed_form.get(key[0]) == '') + trimmed_form.delete(key[0]); + } + + return trimmed_form; +} \ No newline at end of file -- cgit v1.2.3