ADD: SignedUrls for documents, mainImage and images
ADD: Bucket and Upload System ADD: New errors ADD: Virtuals for categories ADD: Features system ADD: File management system
This commit is contained in:
@@ -12,10 +12,6 @@ const categorySchema = new mongoose.Schema(
|
||||
required: true,
|
||||
unique: true,
|
||||
},
|
||||
parentId: {
|
||||
type: ObjectID,
|
||||
ref: 'Category',
|
||||
},
|
||||
},
|
||||
{
|
||||
toJSON: { virtuals: true },
|
||||
@@ -24,5 +20,11 @@ const categorySchema = new mongoose.Schema(
|
||||
}
|
||||
)
|
||||
|
||||
categorySchema.virtual('features', {
|
||||
ref: 'Feature',
|
||||
localField: '_id',
|
||||
foreignField: 'category',
|
||||
})
|
||||
|
||||
const Category = mongoose.model('Category', categorySchema)
|
||||
module.exports = Category
|
||||
|
||||
Reference in New Issue
Block a user