- fix: Date problems... (it was a bad "copy" function, the object date was not valid...)

- fix: error fetch on loading... (offline appeared)
This commit is contained in:
Paolo Arena
2019-02-11 02:59:05 +01:00
parent 636ee92786
commit d24b232a2d
7 changed files with 437 additions and 370 deletions

View File

@@ -44,7 +44,7 @@ var TodoSchema = new mongoose.Schema({
type: Date
},
expiring_at: {
type: Date
type: Date,
},
enableExpiring: {
type: Boolean,
@@ -83,10 +83,15 @@ TodoSchema.statics.findAllByUserId = function (userId) {
};
TodoSchema.pre('save', function (next) {
// var todo = this;
// console.log('todo.expiring_at', todo.expiring_at);
next();
});
var Todo = mongoose.model('Todos', TodoSchema);
module.exports = { Todo };