Add API to see scores
This commit is contained in:
parent
a8374ec779
commit
0620c3e00f
@ -37,6 +37,16 @@ def packages():
|
||||
return jsonify(pkgs)
|
||||
|
||||
|
||||
@bp.route("/api/scores/")
|
||||
def package_scores():
|
||||
qb = QueryBuilder(request.args)
|
||||
query = qb.buildPackageQuery()
|
||||
|
||||
pkgs = [{ "author": package.author.username, "name": package.name, "score": package.score } \
|
||||
for package in query.all()]
|
||||
return jsonify(pkgs)
|
||||
|
||||
|
||||
@bp.route("/api/packages/<author>/<name>/")
|
||||
@is_package_page
|
||||
def package(package):
|
||||
|
@ -21,6 +21,7 @@ You can use the `/api/whoami` to check authentication.
|
||||
### Packages
|
||||
|
||||
* GET `/api/packages/` - See [Package Queries](#package-queries)
|
||||
* GET `/api/scores/` - See [Package Queries](#package-queries)
|
||||
* GET `/api/packages/<username>/<name>/`
|
||||
|
||||
### Releases
|
||||
|
Loading…
x
Reference in New Issue
Block a user