Added ability to restore a completed lilst from List Management. #27

This commit is contained in:
Brian McGonagill 2025-05-26 16:22:58 -05:00
parent dcd0074b28
commit c9c96d214d
5 changed files with 52 additions and 6 deletions

View file

@ -2,7 +2,7 @@ import { Lists } from '../../../imports/api/lists.js';
import { M } from '../../lib/assets/materialize.js';
Template.listMgmtTbl.onCreated(function() {
this.subscribe("myLists");
this.subscribe("allLists");
});
Template.listMgmtTbl.onRendered(function() {
@ -14,7 +14,12 @@ Template.listMgmtTbl.onRendered(function() {
Template.listMgmtTbl.helpers({
lists: function() {
return Lists.find({});
let showComplete = Session.get("showCompletedLists");
if (showComplete) {
return Lists.find({ listComplete: true });
} else {
return Lists.find({});
}
}
});
@ -51,5 +56,16 @@ Template.listMgmtTbl.events({
// console.log(" SUCCESS marking complete.");
}
});
},
'click .markListNotComplete' (event) {
event.preventDefault();
let listId = this._id;
Meteor.call('mark.incomplete', listId, function(err, result) {
if (err) {
} else {
}
});
}
});