fix(recipes): normalize newlines + add update_recipe (v0.6.1)

Bug fix: literal backslash-n sequences in ingredients/instructions are now
converted to real newline characters before sending to the API, so the server
correctly splits ingredient lines into ingredientsList[].

New tool: update_recipe — partial update via mprecipeput with recipe.metaId;
fetches current recipe in the same session to verify can_update and supply
name fallback. Verified: recipe.metaId triggers update (not create).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-16 15:01:40 +02:00
parent ebbbf38ab9
commit bc28b09d49
7 changed files with 260 additions and 12 deletions
+20
View File
@@ -432,6 +432,26 @@ a00.r.r → vollständiges Rezept-Objekt
**Verifiziert am:** 2026-04-16 via FW_DEBUG=1
### `mprecipeput` Rezept aktualisieren (Update)
POST https://api.familywall.com/api/mprecipeput
Identisch zum Create-Aufruf, aber mit zusätzlichem `recipe.metaId`-Parameter.
Der Server unterscheidet Create vs. Update anhand ob `recipe.metaId` vorhanden ist.
Nur geänderte Felder müssen mitgeschickt werden (Partial Update).
`recipe.name` und `recipe.isRecipe="true"` sollten immer mitgeschickt werden.
**Zusätzlicher Parameter:**
| Parameter | Pflicht | Wert |
|---|---|---|
| `recipe.metaId` | ja (für Update) | metaId des zu aktualisierenden Rezepts |
**Newline-Hinweis:** Zutaten und Anleitung müssen echte `\n`-Zeichen enthalten
(nicht die zwei-Zeichen-Sequenz `\n`). Literale Backslash-n werden vom Server
als ein Element interpretiert → kein Splitting in `ingredientsList`.
**Verifiziert am:** 2026-04-16 via FW_DEBUG=1
### `metasync` (id='recipe') Alle Rezepte abrufen
POST https://api.familywall.com/api/metasync