houseofruqaapi / models /Subcategory.js
ShieldX's picture
Upload 13 files
c0fb352 verified
raw
history blame contribute delete
533 Bytes
import mongoose from 'mongoose';
const subcategorySchema = new mongoose.Schema({
name: {
type: String,
required: [true, 'Subcategory name is required'],
trim: true
},
parentCategory: {
type: String,
required: true,
enum: ['Women', 'Men'] // Links it strictly to your main edits
},
image: {
type: String, // Cloudinary URL for the visual bubble
required: true
}
}, {
timestamps: true
});
const Subcategory = mongoose.model('Subcategory', subcategorySchema);
export default Subcategory;