Fix type error with selected category id

master
TZGyn 2 years ago
parent 19f4a2ebde
commit 04c3d8e0d0
Signed by: TZGyn
GPG Key ID: 122EAF77AE81FD4A

@ -33,12 +33,13 @@ export default function NewBookmarkForm({
} }
const submitBookmark = async () => { const submitBookmark = async () => {
if (value === 'all') return
const body = { const body = {
name, name,
link, link,
description, description,
url, url,
category_id: parseInt(value.currentKey), category_id: parseInt(value.values().next().value),
} }
await fetch('/api/bookmark', { await fetch('/api/bookmark', {
method: 'POST', method: 'POST',

Loading…
Cancel
Save