mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 12:18:45 -05:00
fixed ingredient paste and plan share serialize
This commit is contained in:
@@ -234,7 +234,7 @@ class MealTypeSerializer(SpacedModelSerializer, WritableNestedModelSerializer):
|
|||||||
|
|
||||||
class UserPreferenceSerializer(WritableNestedModelSerializer):
|
class UserPreferenceSerializer(WritableNestedModelSerializer):
|
||||||
food_inherit_default = serializers.SerializerMethodField('get_food_inherit_defaults')
|
food_inherit_default = serializers.SerializerMethodField('get_food_inherit_defaults')
|
||||||
plan_share = UserNameSerializer(many=True, allow_null=True, required=False, read_only=True)
|
plan_share = UserNameSerializer(many=True, allow_null=True, required=False)
|
||||||
shopping_share = UserNameSerializer(many=True, allow_null=True, required=False)
|
shopping_share = UserNameSerializer(many=True, allow_null=True, required=False)
|
||||||
food_children_exist = serializers.SerializerMethodField('get_food_children_exist')
|
food_children_exist = serializers.SerializerMethodField('get_food_children_exist')
|
||||||
|
|
||||||
|
|||||||
@@ -1136,7 +1136,7 @@ export default {
|
|||||||
if (ing.trim() !== "") {
|
if (ing.trim() !== "") {
|
||||||
this.genericPostAPI("api_ingredient_from_string", {text: ing}).then((result) => {
|
this.genericPostAPI("api_ingredient_from_string", {text: ing}).then((result) => {
|
||||||
let unit = null
|
let unit = null
|
||||||
if (result.data.unit !== "") {
|
if (result.data.unit !== "" && result.data.unit !== null) {
|
||||||
unit = {name: result.data.unit}
|
unit = {name: result.data.unit}
|
||||||
}
|
}
|
||||||
this.recipe.steps[step].ingredients.splice(order, 0, {
|
this.recipe.steps[step].ingredients.splice(order, 0, {
|
||||||
|
|||||||
Reference in New Issue
Block a user