undefined / models /Department.js
sverdlov's picture
you're created the user interface, but it is not functional, just plain HTML. Write the code for the backend properly.
55f89e1 verified
Raw
History Blame Contribute Delete
458 Bytes
```javascript
const mongoose = require('mongoose');
const DepartmentSchema = new mongoose.Schema({
name: {
type: String,
required: true,
unique: true
},
description: {
type: String
},
manager: {
type: mongoose.Schema.Types.ObjectId,
ref: 'User'
},
date: {
type: Date,
default: Date.now
}
});
module.exports = mongoose.model('Department', DepartmentSchema);
```