diff --git a/app/routes/pages.py b/app/routes/pages.py index 78783b7..a89f396 100644 --- a/app/routes/pages.py +++ b/app/routes/pages.py @@ -2,6 +2,8 @@ from flask import Blueprint, make_response, render_template, request +from app import get_db + bp = Blueprint("pages", __name__) @@ -32,7 +34,12 @@ def feedback(): if email and not re.match(r"^[^\s@]+@[^\s@]+\.[^\s@]+$", email): return render_template("partials/feedback_error.html"), 422 - # TODO: persist/email submission + db = get_db() + db.execute( + "INSERT INTO feedback (rating, comment, email) VALUES (?, ?, ?)", + (rating, comment, email or None), + ) + db.commit() return render_template("partials/feedback_success.html"), 200