From 04c3d8e0d087edb008943219b04c513316f741d1 Mon Sep 17 00:00:00 2001 From: TZGyn Date: Sun, 27 Aug 2023 01:55:57 +0800 Subject: [PATCH] Fix type error with selected category id --- components/newBookmarkForm.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/newBookmarkForm.tsx b/components/newBookmarkForm.tsx index afe466f..aa59d28 100644 --- a/components/newBookmarkForm.tsx +++ b/components/newBookmarkForm.tsx @@ -33,12 +33,13 @@ export default function NewBookmarkForm({ } const submitBookmark = async () => { + if (value === 'all') return const body = { name, link, description, url, - category_id: parseInt(value.currentKey), + category_id: parseInt(value.values().next().value), } await fetch('/api/bookmark', { method: 'POST',