mirror of
https://github.com/myfatemi04/wheelshare-old-backend.git
synced 2025-04-09 14:40:17 -04:00
update Pool model
This commit is contained in:
parent
f3ae54ffc4
commit
4947d68bb1
|
@ -10,6 +10,8 @@ router.post('/:poolID/comment', requireApiAuth, async (req, res) => {
|
|||
const poolID = req.params.poolID;
|
||||
const commentBody = req.body.body;
|
||||
|
||||
console.log(req.body);
|
||||
|
||||
await PoolModel.updateOne(
|
||||
{ _id: poolID },
|
||||
{
|
||||
|
@ -17,6 +19,7 @@ router.post('/:poolID/comment', requireApiAuth, async (req, res) => {
|
|||
comments: {
|
||||
author_id: userID,
|
||||
body: commentBody,
|
||||
created_at: new Date().toISOString(),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ export interface Group extends Document {
|
|||
export interface Comment {
|
||||
body: string;
|
||||
author_id: string;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
const UserSchema: Schema = new Schema({
|
||||
|
@ -39,8 +40,9 @@ const GroupSchema: Schema = new Schema({
|
|||
const GroupModel: Model<Group> = model('Group', GroupSchema);
|
||||
|
||||
const CommentSchema: Schema = new Schema({
|
||||
text: { type: String, required: true },
|
||||
body: { type: String, required: true },
|
||||
author_id: { type: String, required: true },
|
||||
created_at: { type: String, required: true },
|
||||
});
|
||||
|
||||
const CommentModel = model('Comment', CommentSchema);
|
||||
|
|
Loading…
Reference in New Issue
Block a user