History added + User tested

This commit is contained in:
Yûki VACHOT 2021-11-02 04:37:22 +01:00
parent f774cf64bd
commit 4629b42b36
8 changed files with 197 additions and 107 deletions

View file

@ -0,0 +1,15 @@
module.exports = mongoose => {
let schema = mongoose.Schema({
user: Object
},
{ timestamps: true }
);
schema.method("toJSON", function() {
const { __v, _id, ...object } = this.toObject();
object.id = _id;
return object;
});
return mongoose.model("history", schema);
};