diff --git a/src/App.svelte b/src/App.svelte index 2d540f3..1904312 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -8,12 +8,13 @@ export let bio: string; let slugIsAuto = true; + let errors = []; function generateAuthor(e) { e.preventDefault() // Check the formatting - let errors = [] + errors = [] // First, make sure the required fields are filled for (let [k,v] of [ @@ -34,9 +35,7 @@ // Validate slug formatting - if (errors.length) { - alert(`There are some errors: ${errors}`) - } else { + if (!errors.length) { alert(`Name: ${name} email, ${email} has slug ${slug} and bio ${bio}`) } } @@ -87,6 +86,17 @@
Enter your new author details below. Once done, click on the "Generate" button to receive a special file that you can import to Ghost to add the author details to the "staff". This will let you select them as the author when publishing a post.