From 63d358df36eb10618ab6bc0515d5350589302fe2 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Fri, 29 Aug 2025 13:08:16 +0200 Subject: [PATCH] indicate private reciesp --- cookbook/serializer.py | 2 +- .../components/display/PrivateRecipeBadge.vue | 27 +++++++++++++++++++ vue3/src/components/display/RecipeCard.vue | 5 ++++ vue3/src/components/display/RecipeView.vue | 4 +++ vue3/src/openapi/models/RecipeOverview.ts | 8 ++++++ 5 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 vue3/src/components/display/PrivateRecipeBadge.vue diff --git a/cookbook/serializer.py b/cookbook/serializer.py index df6d4c117..353f76969 100644 --- a/cookbook/serializer.py +++ b/cookbook/serializer.py @@ -1038,7 +1038,7 @@ class RecipeOverviewSerializer(RecipeBaseSerializer): fields = ( 'id', 'name', 'description', 'image', 'keywords', 'working_time', 'waiting_time', 'created_by', 'created_at', 'updated_at', - 'internal', 'servings', 'servings_text', 'rating', 'last_cooked', 'new', 'recent' + 'internal', 'private','servings', 'servings_text', 'rating', 'last_cooked', 'new', 'recent' ) # TODO having these readonly fields makes "RecipeOverview.ts" (API Client) not generate the RecipeOverviewToJSON second else block which leads to errors when using the api # TODO find a solution (custom schema?) to have these fields readonly (to save performance) and generate a proper client (two serializers would probably do the trick) diff --git a/vue3/src/components/display/PrivateRecipeBadge.vue b/vue3/src/components/display/PrivateRecipeBadge.vue new file mode 100644 index 000000000..2738d1e4c --- /dev/null +++ b/vue3/src/components/display/PrivateRecipeBadge.vue @@ -0,0 +1,27 @@ + + + + + \ No newline at end of file diff --git a/vue3/src/components/display/RecipeCard.vue b/vue3/src/components/display/RecipeCard.vue index e1c91df95..ab9229daa 100644 --- a/vue3/src/components/display/RecipeCard.vue +++ b/vue3/src/components/display/RecipeCard.vue @@ -19,6 +19,10 @@