mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2025-12-23 18:29:23 -05:00
category change fix
This commit is contained in:
@@ -1435,7 +1435,7 @@ class ShoppingListRecipeSerializer(serializers.ModelSerializer):
|
|||||||
|
|
||||||
class FoodShoppingSerializer(serializers.ModelSerializer):
|
class FoodShoppingSerializer(serializers.ModelSerializer):
|
||||||
supermarket_category = SupermarketCategorySerializer(read_only=True)
|
supermarket_category = SupermarketCategorySerializer(read_only=True)
|
||||||
shopping_lists = ShoppingListSerializer(read_only=True)
|
shopping_lists = ShoppingListSerializer(read_only=True, many=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Food
|
model = Food
|
||||||
|
|||||||
@@ -174,6 +174,7 @@ const isShoppingLineDelayed = computed(() => {
|
|||||||
function categoryUpdate(category: SupermarketCategory) {
|
function categoryUpdate(category: SupermarketCategory) {
|
||||||
const api = new ApiApi()
|
const api = new ApiApi()
|
||||||
shoppingListFood.value.food.supermarketCategory = category
|
shoppingListFood.value.food.supermarketCategory = category
|
||||||
|
useShoppingStore().updateEntriesStructure()
|
||||||
api.apiFoodUpdate({id: shoppingListFood.value.food.id, food: shoppingListFood.value.food}).then(r => {
|
api.apiFoodUpdate({id: shoppingListFood.value.food.id, food: shoppingListFood.value.food}).then(r => {
|
||||||
useMessageStore().addPreparedMessage(PreparedMessage.UPDATE_SUCCESS)
|
useMessageStore().addPreparedMessage(PreparedMessage.UPDATE_SUCCESS)
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
|||||||
@@ -58,10 +58,10 @@ export interface FoodShopping {
|
|||||||
readonly supermarketCategory: SupermarketCategory;
|
readonly supermarketCategory: SupermarketCategory;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @type {ShoppingList}
|
* @type {Array<ShoppingList>}
|
||||||
* @memberof FoodShopping
|
* @memberof FoodShopping
|
||||||
*/
|
*/
|
||||||
readonly shoppingLists: ShoppingList;
|
readonly shoppingLists: Array<ShoppingList>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -88,7 +88,7 @@ export function FoodShoppingFromJSONTyped(json: any, ignoreDiscriminator: boolea
|
|||||||
'name': json['name'],
|
'name': json['name'],
|
||||||
'pluralName': json['plural_name'] == null ? undefined : json['plural_name'],
|
'pluralName': json['plural_name'] == null ? undefined : json['plural_name'],
|
||||||
'supermarketCategory': SupermarketCategoryFromJSON(json['supermarket_category']),
|
'supermarketCategory': SupermarketCategoryFromJSON(json['supermarket_category']),
|
||||||
'shoppingLists': ShoppingListFromJSON(json['shopping_lists']),
|
'shoppingLists': ((json['shopping_lists'] as Array<any>).map(ShoppingListFromJSON)),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user