Update
This commit is contained in:
parent
80b0ea401b
commit
c620e19449
23 changed files with 919 additions and 0 deletions
18
app-backend/models/image.model.js
Normal file
18
app-backend/models/image.model.js
Normal 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);
|
||||
};
|
||||
Reference in a new issue