Post routes

This commit is contained in:
Andrew Trieu
2023-07-11 19:45:01 +03:00
committed by Andrew Trieu
parent 6c35f7d006
commit a25ea2d90a
9 changed files with 150 additions and 14 deletions

32
server/models/Post.js Normal file
View 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;