diff --git a/cookbook/serializer.py b/cookbook/serializer.py index ff8e8093f..1cf14dabb 100644 --- a/cookbook/serializer.py +++ b/cookbook/serializer.py @@ -1245,7 +1245,7 @@ class ShoppingListEntrySerializer(WritableNestedModelSerializer): validated_data['created_by'] = self.context['request'].user if 'mealplan_id' in validated_data: - if existing_slr := ShoppingListRecipe.objects.filter(mealplan_id=validated_data['mealplan_id'], space=self.context['request'].space).get(): + if existing_slr := ShoppingListRecipe.objects.filter(mealplan_id=validated_data['mealplan_id'], space=self.context['request'].space).first(): validated_data['list_recipe'] = existing_slr else: validated_data['list_recipe'] = ShoppingListRecipe.objects.create(mealplan_id=validated_data['mealplan_id'], space=self.context['request'].space, created_by=self.context['request'].user) @@ -1271,7 +1271,7 @@ class ShoppingListEntrySerializer(WritableNestedModelSerializer): class Meta: model = ShoppingListEntry fields = ( - 'id', 'list_recipe', 'food', 'unit', 'amount', 'order', 'checked', + 'id', 'list_recipe', 'food', 'unit', 'amount', 'order', 'checked', 'ingredient', 'list_recipe_data', 'created_by', 'created_at', 'updated_at', 'completed_at', 'delay_until', 'mealplan_id' ) read_only_fields = ('id', 'created_by', 'created_at') diff --git a/vue3/src/components/dialogs/ShoppingLineItemDialog.vue b/vue3/src/components/dialogs/ShoppingLineItemDialog.vue index 7df931c93..8b8e30ed9 100644 --- a/vue3/src/components/dialogs/ShoppingLineItemDialog.vue +++ b/vue3/src/components/dialogs/ShoppingLineItemDialog.vue @@ -11,7 +11,7 @@ + @click="useShoppingStore().delayEntries(entriesList, !isShoppingLineDelayed, true); showDialog=false"> {{ $t('ShopLater') }} {{ $t('ShopNow') }} @@ -78,26 +78,26 @@ - + - + - + - + - + - diff --git a/vue3/src/openapi/apis/ApiApi.ts b/vue3/src/openapi/apis/ApiApi.ts index ffbae9ac6..313428d6a 100644 --- a/vue3/src/openapi/apis/ApiApi.ts +++ b/vue3/src/openapi/apis/ApiApi.ts @@ -1282,7 +1282,7 @@ export interface ApiShoppingListRecipeBulkCreateEntriesCreateRequest { } export interface ApiShoppingListRecipeCreateRequest { - shoppingListRecipe: Omit; + shoppingListRecipe: Omit; } export interface ApiShoppingListRecipeDestroyRequest { @@ -1297,7 +1297,7 @@ export interface ApiShoppingListRecipeListRequest { export interface ApiShoppingListRecipePartialUpdateRequest { id: number; - patchedShoppingListRecipe?: Omit; + patchedShoppingListRecipe?: Omit; } export interface ApiShoppingListRecipeRetrieveRequest { @@ -1306,7 +1306,7 @@ export interface ApiShoppingListRecipeRetrieveRequest { export interface ApiShoppingListRecipeUpdateRequest { id: number; - shoppingListRecipe: Omit; + shoppingListRecipe: Omit; } export interface ApiSpaceListRequest { diff --git a/vue3/src/openapi/models/PatchedShoppingListEntry.ts b/vue3/src/openapi/models/PatchedShoppingListEntry.ts index 7291a40f3..a437707c1 100644 --- a/vue3/src/openapi/models/PatchedShoppingListEntry.ts +++ b/vue3/src/openapi/models/PatchedShoppingListEntry.ts @@ -90,6 +90,12 @@ export interface PatchedShoppingListEntry { * @memberof PatchedShoppingListEntry */ checked?: boolean; + /** + * + * @type {number} + * @memberof PatchedShoppingListEntry + */ + ingredient?: number | null; /** * * @type {ShoppingListRecipe} @@ -158,6 +164,7 @@ export function PatchedShoppingListEntryFromJSONTyped(json: any, ignoreDiscrimin 'amount': json['amount'] == null ? undefined : json['amount'], 'order': json['order'] == null ? undefined : json['order'], 'checked': json['checked'] == null ? undefined : json['checked'], + 'ingredient': json['ingredient'] == null ? undefined : json['ingredient'], 'listRecipeData': json['list_recipe_data'] == null ? undefined : ShoppingListRecipeFromJSON(json['list_recipe_data']), 'createdBy': json['created_by'] == null ? undefined : UserFromJSON(json['created_by']), 'createdAt': json['created_at'] == null ? undefined : (new Date(json['created_at'])), @@ -186,6 +193,7 @@ export function PatchedShoppingListEntryToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { +export function PatchedShoppingListRecipeToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } diff --git a/vue3/src/openapi/models/ShoppingListEntry.ts b/vue3/src/openapi/models/ShoppingListEntry.ts index f22926d1f..559636424 100644 --- a/vue3/src/openapi/models/ShoppingListEntry.ts +++ b/vue3/src/openapi/models/ShoppingListEntry.ts @@ -90,6 +90,12 @@ export interface ShoppingListEntry { * @memberof ShoppingListEntry */ checked?: boolean; + /** + * + * @type {number} + * @memberof ShoppingListEntry + */ + ingredient?: number | null; /** * * @type {ShoppingListRecipe} @@ -164,6 +170,7 @@ export function ShoppingListEntryFromJSONTyped(json: any, ignoreDiscriminator: b 'amount': json['amount'], 'order': json['order'] == null ? undefined : json['order'], 'checked': json['checked'] == null ? undefined : json['checked'], + 'ingredient': json['ingredient'] == null ? undefined : json['ingredient'], 'listRecipeData': ShoppingListRecipeFromJSON(json['list_recipe_data']), 'createdBy': UserFromJSON(json['created_by']), 'createdAt': (new Date(json['created_at'])), @@ -192,6 +199,7 @@ export function ShoppingListEntryToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { +export function ShoppingListRecipeToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; }