somewhere

This commit is contained in:
Swift
2023-08-17 13:05:51 +03:30
parent 30c7eb0e7b
commit 53843207cc
429 changed files with 117489 additions and 1 deletions
+17
View File
@@ -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)