aboutsummaryrefslogtreecommitdiff
path: root/gn3
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-08-28 09:56:18 +0300
committerFrederick Muriuki Muriithi2023-10-10 11:12:44 +0300
commit3757c2bc9adcf687f1653c2b903aa1edbcafafb1 (patch)
treed790e8904f7844cdda18e61f9f162f9328b41b84 /gn3
parentc6f59f456a0daa8b6263cc5960ac6eb80adf20a4 (diff)
downloadgenenetwork3-3757c2bc9adcf687f1653c2b903aa1edbcafafb1.tar.gz
Add scaffolding for add/delete endpoints.
Diffstat (limited to 'gn3')
-rw-r--r--gn3/case_attributes.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/gn3/case_attributes.py b/gn3/case_attributes.py
index 9f2370d..39052f9 100644
--- a/gn3/case_attributes.py
+++ b/gn3/case_attributes.py
@@ -112,6 +112,22 @@ def __reject_diff__(conn: Connection, user: User, diff_filename) -> None:
# TODO: Check user has "approve/reject case attribute diff privileges"
raise NotImplementedError
+@caseattr.route("/<int:inbredset_id>/add", methods=["POST"])
+def add_case_attributes(inbredset_id: int) -> Response:
+ """Add a new case attribute for `InbredSetId`."""
+ with (require_oauth.acquire("profile resource") as the_token,
+ database_connection(current_app.config["SQL_URI"]) as conn):
+ # TODO: Check user has "add/delete case attribute privileges."
+ raise NotImplementedError
+
+@caseattr.route("/<int:inbredset_id>/delete", methods=["POST"])
+def delete_case_attributes(inbredset_id: int) -> Response:
+ """Delete a case attribute from `InbredSetId`."""
+ with (require_oauth.acquire("profile resource") as the_token,
+ database_connection(current_app.config["SQL_URI"]) as conn):
+ # TODO: Check user has "add/delete case attribute privileges."
+ raise NotImplementedError
+
@caseattr.route("/<int:inbredset_id>/edit", methods=["POST"])
def edit_case_attributes(inbredset_id: int) -> Response:
"""Edit the case attributes for `InbredSetId` based on data received."""