recipeposform postMessage back

This commit is contained in:
Kurt Riddlesperger 2019-12-20 12:49:44 -06:00
parent aa0619dd73
commit d94e52316c

View File

@ -15,7 +15,8 @@ $('#save-recipe-pos-button').on('click', function (e)
Grocy.Api.Post('objects/recipes_pos', jsonData, Grocy.Api.Post('objects/recipes_pos', jsonData,
function(result) function(result)
{ {
window.location.href = U('/recipe/' + Grocy.EditObjectParentId); window.parent.postMessage(WindowMessageBag("IngredientsChanged"), Grocy.BaseUrl);
window.parent.postMessage(WindowMessageBag("CloseAllModals"), Grocy.BaseUrl);
}, },
function(xhr) function(xhr)
{ {
@ -29,7 +30,8 @@ $('#save-recipe-pos-button').on('click', function (e)
Grocy.Api.Put('objects/recipes_pos/' + Grocy.EditObjectId, jsonData, Grocy.Api.Put('objects/recipes_pos/' + Grocy.EditObjectId, jsonData,
function(result) function(result)
{ {
window.location.href = U('/recipe/' + Grocy.EditObjectParentId); window.parent.postMessage(WindowMessageBag("IngredientsChanged"), Grocy.BaseUrl);
window.parent.postMessage(WindowMessageBag("CloseAllModals"), Grocy.BaseUrl);
}, },
function(xhr) function(xhr)
{ {