mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
Aded Task cleanup by number of weeks or months
This commit is contained in:
parent
e60c32894c
commit
98bcbcd256
6 changed files with 93 additions and 23 deletions
|
|
@ -25,27 +25,40 @@ Template.cleanUpModalConfirm.events({
|
|||
|
||||
switch(whatItems) {
|
||||
case "Lists":
|
||||
cleanUp("clean.Lists");
|
||||
cleanUp("clean.Lists", whatItems);
|
||||
case "Menus":
|
||||
cleanUp("clean.Menus");
|
||||
cleanUp("clean.Menus", whatItems);
|
||||
case "Products":
|
||||
// cleanUp("clean.Products");
|
||||
// cleanUp("clean.Products", whatItems);
|
||||
case "Stores":
|
||||
// cleanUp("clean.Stores");
|
||||
// cleanUp("clean.Stores", whatItems);
|
||||
case "Tasks":
|
||||
// cleanUp("clean.Tasks");
|
||||
cleanTasks("clean.Tasks", whatItems);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
cleanUp = function(methodName) {
|
||||
cleanUp = function(methodName, whatItems) {
|
||||
Meteor.call(methodName, function(err, result) {
|
||||
if (err) {
|
||||
console.log(" ERROR cleaning lists: " + err)
|
||||
console.log(" ERROR cleaning " + whatItems + ": " + err);
|
||||
} else {
|
||||
showSnackbar("Lists have been cleaned up!", "green");
|
||||
showSnackbar(whatItems + " have been cleaned up!", "green");
|
||||
let confirmModal = document.getElementById('cleanUpConfirm');
|
||||
M.Modal.getInstance(confirmModal).close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
cleanTasks = function(methodName, whatItems) {
|
||||
let timeFrame = Session.get("overdueVal");
|
||||
Meteor.call(methodName, timeFrame, function(err, result) {
|
||||
if (err) {
|
||||
console.log(" ERROR cleaning " + whatItems + ": " + err);
|
||||
} else {
|
||||
showSnackbar(whatItems + " have been cleaned up!", "green");
|
||||
let confirmModal = document.getElementById('cleanUpConfirm');
|
||||
M.Modal.getInstance(confirmModal).close();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue