summaryrefslogtreecommitdiff
path: root/src/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'src/controllers')
-rw-r--r--src/controllers/__init__.py1
-rw-r--r--src/controllers/replies_controller.py18
2 files changed, 19 insertions, 0 deletions
diff --git a/src/controllers/__init__.py b/src/controllers/__init__.py
index 0fa79a7..56db251 100644
--- a/src/controllers/__init__.py
+++ b/src/controllers/__init__.py
@@ -1,2 +1,3 @@
import src.controllers.comments_controller
+import src.controllers.replies_controller
import src.controllers.dashboard_controller
diff --git a/src/controllers/replies_controller.py b/src/controllers/replies_controller.py
new file mode 100644
index 0000000..9228b5c
--- /dev/null
+++ b/src/controllers/replies_controller.py
@@ -0,0 +1,18 @@
+from flask import Blueprint, request, abort, render_template
+from src.services import CreateReplyService
+
+
+replies_blueprint = Blueprint('replies_controller',
+ '__replies_controller__')
+
+
+@replies_blueprint.post('/comments/<int:comment_id>/replies')
+def create(comment_id):
+ breakpoint()
+ service = CreateReplyService(request.get_json(), comment_id)
+ status_code = service.call()
+
+ if status_code != 200:
+ abort(status_code)
+
+ return render_template('comments/index.jinja')