save functions updated

This commit is contained in:
2026-03-19 16:46:47 +00:00
parent 4fb02cecae
commit bbdfda5c3d
2 changed files with 11 additions and 35 deletions

View File

@@ -102,12 +102,16 @@ const saveToCollection = async () => {
saving.value = true
try {
await $fetch(`${config.public.apiBase}api/recipe/save`, {
const response = await $fetch(`${config.public.apiBase}api/recipe/save`, {
method: 'POST',
credentials: 'include',
body: recipe.value
})
if (response && response.id) {
recipe.value.id = response.id
}
hasSaved.value = true
} catch (error) {
console.error("Save failed:", error)