aboutsummaryrefslogtreecommitdiff
path: root/gn3/api
diff options
context:
space:
mode:
authorJohn Nduli2024-08-29 10:58:43 +0300
committerBonfaceKilz2024-08-29 15:34:44 +0300
commit88a6fe43b6e0067b60d871a22cff40e197ab98ac (patch)
treedd6d635e1ee8e52705ca0d90635113ade3616c70 /gn3/api
parentc33cfc004e3b7f3e1dc52d3e89c785a175edd0d6 (diff)
downloadgenenetwork3-88a6fe43b6e0067b60d871a22cff40e197ab98ac.tar.gz
docs: add function comments
Diffstat (limited to 'gn3/api')
-rw-r--r--gn3/api/metadata_api/wiki.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/gn3/api/metadata_api/wiki.py b/gn3/api/metadata_api/wiki.py
index 32872f3..a4abef6 100644
--- a/gn3/api/metadata_api/wiki.py
+++ b/gn3/api/metadata_api/wiki.py
@@ -89,24 +89,31 @@ def get_wiki_entries(symbol: str):
@wiki_blueprint.route("/<int:comment_id>", methods=["GET"])
def get_wiki(comment_id: int):
+ """
+ Gets latest wiki comments.
+
+ TODO: fetch this from RIF
+ """
with db_utils.database_connection(current_app.config["SQL_URI"]) as conn:
return jsonify(wiki.get_latest_comment(conn, comment_id))
- return jsonify(error="Error editting wiki entry, most likely due to DB error!"), 500
+ return jsonify(error="Error fetching wiki entry, most likely due to DB error!"), 500
@wiki_blueprint.route("/categories", methods=["GET"])
def get_categories():
+ """ Gets list of supported categories for RIF """
with db_utils.database_connection(current_app.config["SQL_URI"]) as conn:
cursor = conn.cursor()
categories_dict = wiki.get_categories(cursor)
return jsonify(categories_dict)
- return jsonify(error="Error editting wiki entry, most likely due to DB error!"), 500
+ return jsonify(error="Error getting categories, most likely due to DB error!"), 500
@wiki_blueprint.route("/species", methods=["GET"])
def get_species():
+ """ Gets list of all species, contains name and SpeciesName """
with db_utils.database_connection(current_app.config["SQL_URI"]) as conn:
cursor = conn.cursor()
species_dict = wiki.get_species(cursor)
return jsonify(species_dict)
- return jsonify(error="Error editting wiki entry, most likely due to DB error!"), 500
+ return jsonify(error="Error getting species, most likely due to DB error!"), 500