Added a "Clear done items" button to the shopping list (closes #1999)

This commit is contained in:
Bernd Bestel
2022-11-19 19:45:00 +01:00
parent 605ceb1b19
commit 6affa01f81
4 changed files with 30 additions and 6 deletions

View File

@@ -236,6 +236,20 @@ $(document).on('click', '#clear-shopping-list', function(e)
});
});
$(document).on("click", "#clear-done-items", function(e)
{
Grocy.Api.Post('stock/shoppinglist/clear', { "list_id": $("#selected-shopping-list").val(), "done_only": true },
function(result)
{
window.location.reload();
},
function(xhr)
{
console.error(xhr);
}
);
});
$(document).on('click', '.shopping-list-stock-add-workflow-list-item-button', function(e)
{
e.preventDefault();