From cba80aeac9d00da595aabc13194a6472b4141185 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sat, 18 Jan 2025 14:46:19 +0100 Subject: [PATCH] fixed serializer and step editor --- cookbook/serializer.py | 2 +- vue3/src/components/inputs/StepEditor.vue | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cookbook/serializer.py b/cookbook/serializer.py index 4cf2d8ce7..0a38872ba 100644 --- a/cookbook/serializer.py +++ b/cookbook/serializer.py @@ -649,7 +649,7 @@ class RecipeSimpleSerializer(WritableNestedModelSerializer): @extend_schema_field(str) def get_url(self, obj): - return reverse('view_recipe', args=[obj.id]) + return f'recipe/{obj.pk}' def create(self, validated_data): # don't allow writing to Recipe via this API diff --git a/vue3/src/components/inputs/StepEditor.vue b/vue3/src/components/inputs/StepEditor.vue index 314fa8e18..518e9728b 100644 --- a/vue3/src/components/inputs/StepEditor.vue +++ b/vue3/src/components/inputs/StepEditor.vue @@ -324,10 +324,10 @@ function parseAndInsertIngredients() { Promise.allSettled(promises).then(r => { r.forEach(i => { step.value.ingredients.push({ - amount: i.value.amount, - food: i.value.food, - unit: i.value.unit, - note: i.value.note + amount: i.amount, + food: i.food, + unit: i.unit, + note: i.note } as Ingredient) }) ingredientTextInput.value = ""