From c0952287df9b03a956985276c7c7b1d9b1f0652c Mon Sep 17 00:00:00 2001 From: Hasan Ali Date: Sat, 27 Jun 2020 18:37:10 +0100 Subject: [PATCH] Remove trailing slash from posts api root --- drp/api/posts.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drp/api/posts.py b/drp/api/posts.py index b421666..156c46d 100644 --- a/drp/api/posts.py +++ b/drp/api/posts.py @@ -52,7 +52,7 @@ def serialize_post(post): } -@posts.route("/", methods=["GET", "POST"]) +@posts.route("", methods=["GET", "POST"]) def all_posts(): if request.method == "GET": return get_posts() @@ -68,10 +68,8 @@ def get_posts(): page = request.args.get("page") per_page = request.args.get("per_page") - query = Post.query.join(Post.latest_rev) \ - .options( - joinedload("latest_rev") - .options( + query = Post.query.join(Post.latest_rev).options( + joinedload("latest_rev").options( joinedload("tags"), joinedload("files")))