From 1ffc71d7da7e4a63893b560672728e5e6aebc29a Mon Sep 17 00:00:00 2001 From: selectthegang Date: Wed, 6 Jul 2022 20:57:58 -0500 Subject: [PATCH] Update src/routes/edit/[slug].svelte Co-authored-by: mat <27899617+mat-1@users.noreply.github.com> --- src/routes/edit/[slug].svelte | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/routes/edit/[slug].svelte b/src/routes/edit/[slug].svelte index e233fd48..0420b804 100644 --- a/src/routes/edit/[slug].svelte +++ b/src/routes/edit/[slug].svelte @@ -47,10 +47,7 @@ async function submitEntry() { // make a put request to /api/entry/.json // if successful, redirect to /entry/ - entryTags = entryTags.split(',') - if (entryTags.length == 1 && entryTags[0] == '') { - entryTags = [] - } + entryTags = entryTags.split(',').map(tag => tag.trim()).filter(tag => tag.length > 0) const response: Entry | { error: string } = await fetch(`/api/entry/${entry.id}.json`, { method: 'PUT', headers: {