Merge pull request #197 from nagisa77/codex/fix-draft-saving-with-custom-tags

Fix draft saving when custom tags present
This commit is contained in:
Tim
2025-07-14 16:31:31 +08:00
committed by GitHub
+2 -1
View File
@@ -98,6 +98,7 @@ export default {
return return
} }
try { try {
const tagIds = selectedTags.value.filter(t => typeof t === 'number')
const res = await fetch(`${API_BASE_URL}/api/drafts`, { const res = await fetch(`${API_BASE_URL}/api/drafts`, {
method: 'POST', method: 'POST',
headers: { headers: {
@@ -108,7 +109,7 @@ export default {
title: title.value, title: title.value,
content: content.value, content: content.value,
categoryId: selectedCategory.value || null, categoryId: selectedCategory.value || null,
tagIds: selectedTags.value tagIds
}) })
}) })
if (res.ok) { if (res.ok) {