#39 Added endpoint to get a specific course by id
This commit was merged in pull request #41.
This commit is contained in:
@@ -125,6 +125,14 @@ def get_courses(id):
|
|||||||
resp = jsonify(d)
|
resp = jsonify(d)
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
|
@bp.route("/course/<int:id>", methods=["GET"])
|
||||||
|
@login_required
|
||||||
|
def get_course(id):
|
||||||
|
c = Course.query.get(id)
|
||||||
|
if not c:
|
||||||
|
return error_response(400, f"course with id {id} not found")
|
||||||
|
resp = jsonify(c.to_dict())
|
||||||
|
return resp
|
||||||
|
|
||||||
@bp.route("/user/<int:uid>/enroll/<int:cid>", methods=["POST", "DELETE"])
|
@bp.route("/user/<int:uid>/enroll/<int:cid>", methods=["POST", "DELETE"])
|
||||||
@login_required
|
@login_required
|
||||||
|
|||||||
Reference in New Issue
Block a user