diff --git a/client/components/new-post/index.tsx b/client/components/new-post/index.tsx index fa3f3dc3..679946f8 100644 --- a/client/components/new-post/index.tsx +++ b/client/components/new-post/index.tsx @@ -74,7 +74,14 @@ const Post = () => { text: 'Please fill out the post title', type: 'error' }) - setSubmitting(false) + hasErrored = true + } + + if (!docs.length) { + setToast({ + text: 'Please add at least one document', + type: 'error' + }) hasErrored = true } @@ -84,12 +91,14 @@ const Post = () => { text: 'Please fill out all the document titles', type: 'error' }) - setSubmitting(false) hasErrored = true } } - if (hasErrored) return + if (hasErrored) { + setSubmitting(false) + return + } await sendRequest('/server-api/posts/create', { title, diff --git a/server/src/database.ts b/server/src/database.ts index deae23a2..17f0bc31 100644 --- a/server/src/database.ts +++ b/server/src/database.ts @@ -12,9 +12,9 @@ export const sequelize = new Sequelize({ }) if (config.memory_db) { - console.log(`Database path: ${databasePath}`) -} else { console.log("Using in-memory database") +} else { + console.log(`Database path: ${databasePath}`) } export const umzug = new Umzug({