Post routes
This commit is contained in:
committed by
Andrew Trieu
parent
6c35f7d006
commit
a25ea2d90a
32
server/models/Post.js
Normal file
32
server/models/Post.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import mongoose from 'mongoose';
|
||||
|
||||
const PostSchema = new mongoose.Schema({
|
||||
userId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
firstName: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
lastName: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
location: String,
|
||||
content: String,
|
||||
profilePicturePath: String,
|
||||
contentPicturePath: String,
|
||||
likes : {
|
||||
type: Map,
|
||||
of: Boolean,
|
||||
},
|
||||
comments: {
|
||||
type: Array,
|
||||
default: [],
|
||||
}
|
||||
}, { timestamps: true });
|
||||
|
||||
const Post = mongoose.model('Post', PostSchema);
|
||||
|
||||
export default Post;
|
||||
Reference in New Issue
Block a user