Improved meal plan entry reference when deleting an entry (references #255)

This commit is contained in:
Bernd Bestel 2019-06-09 09:10:29 +02:00
parent 825be63b93
commit 6b98fa85d3
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300

View File

@ -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)