7fife-backend/models/categories.model.js

26 lines
518 B
JavaScript
Raw Permalink Normal View History

2024-03-07 13:01:44 +00:00
const mongoose = require('mongoose');
const categorySchema = new mongoose.Schema({
name: {
type: String,
},
image: {
fileName: {
type: String,
2024-03-07 13:01:44 +00:00
},
fileAddress: {
type: String, }
2024-03-07 13:01:44 +00:00
},
imageUrl: { type: String },
status: {
type: String,
enum: ['activate', 'deactivate'],
default: 'activate'
}
}, { timestamps: true }); // Add timestamps option here
const Category = mongoose.model('Category', categorySchema);
module.exports = Category;