diff --git a/backend/app/routes.py b/backend/app/routes.py index d2c2166..f70aab3 100644 --- a/backend/app/routes.py +++ b/backend/app/routes.py @@ -327,3 +327,16 @@ def get_content(id): return error_response(400, f"Content with id {id} does not exist") return jsonify(c.to_dict()) + + +@bp.route("/content/", methods=["DELETE"]) +@login_required +@instructor_required +def delete_content(id): + c = Content.query.get(id) + if not c: + return error_response(400, f"Content with id {id} does not exist") + + db.session.delete(c) + db.session.commit() + return jsonify(c.to_dict())