From 3757c2bc9adcf687f1653c2b903aa1edbcafafb1 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 28 Aug 2023 09:56:18 +0300 Subject: Add scaffolding for add/delete endpoints. --- gn3/case_attributes.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'gn3') 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("//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("//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("//edit", methods=["POST"]) def edit_case_attributes(inbredset_id: int) -> Response: """Edit the case attributes for `InbredSetId` based on data received.""" -- cgit v1.2.3