Skip to content

Commit 878dbc6

Browse files
committed
prevent empty titles to be saved
1 parent 528685d commit 878dbc6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/api/checkSaveConflict.ts

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ export const checkSaveConflict = async ({
1515
database
1616
}: CheckConflictParams) => {
1717
try {
18+
if (title === "") throw new Error("Title can't be empty")
19+
1820
const notion = await getNotion()
1921
const { propertiesIds, tags, tagPropertyIndex, tagIndex } = database
2022
const tag = generateTag(tags[tagPropertyIndex], tagIndex)

0 commit comments

Comments
 (0)