From 5719ce84934290618e158f3fc6ec0b931e2b583a Mon Sep 17 00:00:00 2001 From: fipwmaqzufheoxq92ebc <29818044+fipwmaqzufheoxq92ebc@users.noreply.github.com> Date: Sun, 11 Oct 2020 11:55:40 +0200 Subject: [PATCH] Fixes #1010: Repair recipe-picture upload. --- public/viewjs/recipeform.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/viewjs/recipeform.js b/public/viewjs/recipeform.js index 09501c47..a736b9f3 100644 --- a/public/viewjs/recipeform.js +++ b/public/viewjs/recipeform.js @@ -1,4 +1,4 @@ -function saveRecipePicture(result, location) +function saveRecipePicture(result, location, jsonData) { $recipeId = Grocy.EditObjectId || result.created_object_id; Grocy.Components.UserfieldsForm.Save(() => @@ -43,7 +43,7 @@ $('.save-recipe').on('click', function(e) { console.log(jsonData); Grocy.Api.Post('objects/recipes', jsonData, - (result) => saveRecipePicture(result, location)); + (result) => saveRecipePicture(result, location, jsonData)); return; } @@ -65,7 +65,7 @@ $('.save-recipe').on('click', function(e) } Grocy.Api.Put('objects/recipes/' + Grocy.EditObjectId, jsonData, - (result) => saveRecipePicture(result, location), + (result) => saveRecipePicture(result, location, jsonData), function(xhr) { Grocy.FrontendHelpers.EndUiBusy("recipe-form");