transfer project in github

This commit is contained in:
hamid.zarghami1@gmail.com
2024-05-12 15:29:27 +03:30
commit e644edbd65
348 changed files with 164991 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
const mongoose = require('mongoose')
const mongoosePaginate = require('mongoose-paginate-v2');
function image(img) {
if (img) return '/uploads/images/partySet/' + img
}
const PartySetSchema = mongoose.Schema({
title: String,
description: String,
index: Number,
price: {type: Number, default: 0},
active: {type: Boolean, default: true},
image: {type: String, get: image}
})
PartySetSchema.plugin(mongoosePaginate);
module.exports = mongoose.model('PartySet', PartySetSchema)