back-end done
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
const mongoose = require('mongoose')
|
||||
|
||||
function catalog(pdf) {
|
||||
return '/uploads/pdf/' + pdf
|
||||
}
|
||||
|
||||
const MainCatalogSchema = mongoose.Schema({
|
||||
file: {type: String, get: catalog},
|
||||
created_at: String
|
||||
}, {
|
||||
toObject: {getters: true},
|
||||
toJSON: {getters: true}
|
||||
})
|
||||
|
||||
module.exports = mongoose.model('MainCatalog', MainCatalogSchema)
|
||||
Reference in New Issue
Block a user