transfer project in github
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
const mongoose = require('mongoose')
|
||||
const mongoosePaginate = require('mongoose-paginate-v2');
|
||||
|
||||
function cover(img) {
|
||||
return '/uploads/images/foodCategories/' + img
|
||||
}
|
||||
|
||||
const FoodCategorySchema = mongoose.Schema({
|
||||
name: String,
|
||||
branchId: {type: mongoose.ObjectId, ref: 'StoreInfo'},
|
||||
cover: {type: String, get: cover},
|
||||
type: {type: mongoose.ObjectId, ref: 'MenuType'},
|
||||
index: Number
|
||||
})
|
||||
|
||||
FoodCategorySchema.plugin(mongoosePaginate);
|
||||
|
||||
module.exports = mongoose.model('FoodCategory', FoodCategorySchema)
|
||||
Reference in New Issue
Block a user