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

18
app/models/image.model.js Normal file
View file

@ -0,0 +1,18 @@
module.exports = mongoose => {
let schema = mongoose.Schema({
base64: String,
fromUrl: String,
description: String,
type: Number
},
{ timestamps: true }
);
schema.method("toJSON", function() {
const { __v, _id, ...object } = this.toObject();
object.id = _id;
return object;
});
return mongoose.model("image", schema);
};