aboutsummaryrefslogtreecommitdiff
path: root/app/views/api.py
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2019-03-29 19:45:29 +0000
committerrubenwardy <rw@rubenwardy.com>2019-03-29 19:48:21 +0000
commit885209a6146b7f6d2a0e62a1351791973f2e6677 (patch)
treed6a71db21490c686ba280e37327259f1dba1713b /app/views/api.py
parent4c109d6bd3a904f2531e3bac2e70e8b6f6e04d09 (diff)
downloadcheatdb-885209a6146b7f6d2a0e62a1351791973f2e6677.tar.xz
Add unified topic search in QueryBuilder
Diffstat (limited to 'app/views/api.py')
-rw-r--r--app/views/api.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/views/api.py b/app/views/api.py
index f0f3b92..6d54fdf 100644
--- a/app/views/api.py
+++ b/app/views/api.py
@@ -40,10 +40,9 @@ def api_package_page(package):
@app.route("/api/topics/")
def api_topics_page():
- query = ForumTopic.query \
- .order_by(db.asc(ForumTopic.wip), db.asc(ForumTopic.name), db.asc(ForumTopic.title))
- pkgs = [t.getAsDictionary() for t in query.all()]
- return jsonify(pkgs)
+ qb = QueryBuilder(request.args)
+ query = qb.buildTopicQuery(show_added=True)
+ return jsonify([t.getAsDictionary() for t in query.all()])
@app.route("/api/topic_discard/", methods=["POST"])