This commit is contained in:
Yûki VACHOT 2021-11-12 14:25:10 +01:00
parent b92456d8d3
commit b6130a7268
29 changed files with 16 additions and 779 deletions

View file

@ -1,18 +0,0 @@
module.exports = mongoose => {
let schema = mongoose.Schema({
images: [],
text: String,
subjectTarget: [],
seen: Number
},
{ timestamps: true }
);
schema.method("toJSON", function() {
const { __v, _id, ...object } = this.toObject();
object.id = _id;
return object;
});
return mongoose.model("ad", schema);
};