]> git.lizzy.rs Git - cheatdb.git/commitdiff
Fix bugs, and document
authorrubenwardy <rw@rubenwardy.com>
Fri, 5 Jun 2020 03:46:46 +0000 (04:46 +0100)
committerrubenwardy <rw@rubenwardy.com>
Fri, 5 Jun 2020 03:47:50 +0000 (04:47 +0100)
app/blueprints/api/endpoints.py
app/flatpages/help/api.md

index 051716b4b94d6dfd6b23d0cac49095b83bdf1600..8ac6e708a4b30100f6ab9c82fd7a819ac919edcd 100644 (file)
@@ -58,10 +58,10 @@ def package(package):
 def package_dependencies(package):
        ret = []
 
-       include_optional = request.args.get("include_optional", True)
+       only_hard = request.args.get("only_hard", True)
 
        for dep in package.dependencies:
-               if not include_optional and dep.option:
+               if only_hard and dep.optional:
                        continue
 
                name = None
index b032b5dd9b0dbb9529d06ed885d1b6d55b82bd27..ab5e71c832c730410e3b4c6c7575cf25a3782d9e 100644 (file)
@@ -25,6 +25,8 @@ Tokens can be attained by visiting [Profile > "API Tokens"](/user/tokens/).
 * GET `/api/packages/` - See [Package Queries](#package-queries)
 * GET `/api/scores/` - See [Package Queries](#package-queries)
 * GET `/api/packages/<username>/<name>/`
+* GET `/api/packages/<username>/<name>/`
+    * If query argument `only_hard` is present, only hard deps will be returned.
 
 ### Releases