From 6b98fa85d3ddb384312a601f341f11dddacabbfd Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sun, 9 Jun 2019 09:10:29 +0200 Subject: [PATCH] Improved meal plan entry reference when deleting an entry (references #255) --- public/viewjs/mealplan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/viewjs/mealplan.js b/public/viewjs/mealplan.js index e047c364..d3d1b062 100644 --- a/public/viewjs/mealplan.js +++ b/public/viewjs/mealplan.js @@ -98,7 +98,7 @@ $("#add-recipe-modal").on("shown.bs.modal", function(e) $(document).on("click", ".remove-recipe-button", function(e) { - var mealPlanEntry = JSON.parse($(this).closest(".fc-h-event").attr("data-meal-plan-entry")); + var mealPlanEntry = JSON.parse($(this).parents(".fc-h-event:first").attr("data-meal-plan-entry")); Grocy.Api.Delete('objects/meal_plan/' + mealPlanEntry.id.toString(), { }, function(result)