somewhere
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
const mongoose = require('mongoose')
|
||||
const paginate = require('mongoose-paginate-v2')
|
||||
|
||||
function image(img) {
|
||||
return '/uploads/images/warrantyTerms/' + img
|
||||
}
|
||||
|
||||
const WarrantySchema = mongoose.Schema({
|
||||
_creator: { type: mongoose.ObjectId, ref: 'User' },
|
||||
title: String,
|
||||
short_description: String,
|
||||
description: String,
|
||||
image: { type: String, get: image }
|
||||
})
|
||||
WarrantySchema.plugin(paginate)
|
||||
|
||||
module.exports = mongoose.model('Warranty', WarrantySchema)
|
||||
Reference in New Issue
Block a user