mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
Optimized Userfield save event handling (fixes #2458)
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
if (Grocy.ProductEditFormRedirectUri == "reload")
|
||||
{
|
||||
window.location.reload();
|
||||
return
|
||||
return;
|
||||
}
|
||||
|
||||
var returnTo = GetUriParam('returnto');
|
||||
@@ -42,7 +42,7 @@
|
||||
(xhr) =>
|
||||
{
|
||||
Grocy.FrontendHelpers.EndUiBusy("product-form");
|
||||
Grocy.FrontendHelpers.ShowGenericError('Error while saving, probably this item already exists', xhr.response)
|
||||
Grocy.FrontendHelpers.ShowGenericError('Error while saving, probably this item already exists', xhr.response);
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -107,7 +107,7 @@ $('.save-product-button').on('click', function(e)
|
||||
(xhr) =>
|
||||
{
|
||||
Grocy.FrontendHelpers.EndUiBusy("product-form");
|
||||
Grocy.FrontendHelpers.ShowGenericError('Error while saving, probably this item already exists', xhr.response)
|
||||
Grocy.FrontendHelpers.ShowGenericError('Error while saving, probably this item already exists', xhr.response);
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -116,7 +116,7 @@ $('.save-product-button').on('click', function(e)
|
||||
{
|
||||
jsonData.picture_file_name = null;
|
||||
|
||||
Grocy.Api.DeleteFile(Grocy.ProductPictureFileName, 'productpictures', {},
|
||||
Grocy.Api.DeleteFile(Grocy.ProductPictureFileName, 'productpictures',
|
||||
function(result)
|
||||
{
|
||||
// Nothing to do
|
||||
@@ -124,7 +124,7 @@ $('.save-product-button').on('click', function(e)
|
||||
function(xhr)
|
||||
{
|
||||
Grocy.FrontendHelpers.EndUiBusy("product-form");
|
||||
Grocy.FrontendHelpers.ShowGenericError('Error while saving, probably this item already exists', xhr.response)
|
||||
Grocy.FrontendHelpers.ShowGenericError('Error while saving, probably this item already exists', xhr.response);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user