mirror of
https://github.com/grocy/grocy.git
synced 2025-08-18 03:25:50 +00:00
Added the possibility to merge chores
This commit is contained in:
@@ -79,3 +79,28 @@ if (GetUriParam('include_disabled'))
|
||||
{
|
||||
$("#show-disabled").prop('checked', true);
|
||||
}
|
||||
|
||||
$(".merge-chores-button").on("click", function(e)
|
||||
{
|
||||
var choreId = $(e.currentTarget).attr("data-chore-id");
|
||||
$("#merge-chores-keep").val(choreId);
|
||||
$("#merge-chores-remove").val("");
|
||||
$("#merge-chores-modal").modal("show");
|
||||
});
|
||||
|
||||
$("#merge-chores-save-button").on("click", function()
|
||||
{
|
||||
var choreIdToKeep = $("#merge-chores-keep").val();
|
||||
var choreIdToRemove = $("#merge-chores-remove").val();
|
||||
|
||||
Grocy.Api.Post("chores/" + choreIdToKeep.toString() + "/merge/" + choreIdToRemove.toString(), {},
|
||||
function(result)
|
||||
{
|
||||
window.location.href = U('/chores');
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
Grocy.FrontendHelpers.ShowGenericError('Error while merging', xhr.response);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
Reference in New Issue
Block a user