Fixed missing error message when trying to create a duplicate product

This commit is contained in:
Bernd Bestel 2020-11-12 13:09:46 +01:00
parent ea9722bfa4
commit c121c0483a
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300

View File

@ -87,7 +87,12 @@ $('.save-product-button').on('click', function(e)
if (Grocy.EditMode == 'create')
{
Grocy.Api.Post('objects/products', jsonData,
(result) => saveProductPicture(result, location, jsonData));
(result) => saveProductPicture(result, location, jsonData),
(xhr) =>
{
Grocy.FrontendHelpers.EndUiBusy("product-form");
Grocy.FrontendHelpers.ShowGenericError('Error while saving, probably this item already exists', xhr.response)
});
return;
}