Skip to content
Snippets Groups Projects
Commit 22f47d02 authored by daphtya's avatar daphtya
Browse files

added reply name and date

parent 773bca1c
Branches
1 merge request!5Develop
Pipeline #13212 failed with stage
......@@ -21,7 +21,9 @@ class User(mongo.Document):
class Reply(mongo.EmbeddedDocument):
replier_id = mongo.StringField(max_length=20, required =True)
replier_name = mongo.StringField(required=True)
reply_text = mongo.StringField(required=True)
date = mongo.DateTimeField(default= datetime.utcnow)
class Comment(mongo.Document):
commenter_id = mongo.StringField(max_length=20, required=True)
......
......@@ -62,7 +62,7 @@ def add_reply(user):
"status":401,
"message":"Unauthorized reply"
})
comment.update(reply=db.Reply(replier_id = user.id, reply_text=reply_text))
comment.update(reply=db.Reply(replier_id = user.id, replier_name= user.name, reply_text=reply_text))
return jsonify({
"status":200,
"message":"Reply added successfully"
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment