aboutsummaryrefslogtreecommitdiff
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/post.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/post.js b/models/post.js
index af53543..8227c85 100644
--- a/models/post.js
+++ b/models/post.js
@@ -1,8 +1,8 @@
const mongoose = require('mongoose');
const postSchema = new mongoose.Schema({
- title: String,
- text: String,
+ title: {type: String, required: true},
+ text: {type: String, required: true},
date: {type: Date, default: Date.now}
});