From d9a9be4b4cb4d4beee056cd2855ff92f5e3df68f Mon Sep 17 00:00:00 2001 From: cecilia-uu <117628326+cecilia-uu@users.noreply.github.com> Date: Mon, 17 Jun 2024 17:54:06 +0800 Subject: [PATCH] added documentation for api and fixed: duplicate get_dataset() (#1190) ### What problem does this PR solve? Added the documentation for api and fixed duplicate get_dataset() methods. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) - [x] New Feature (non-breaking change which adds functionality) - [x] Documentation Update --- api/apps/dataset_api.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/api/apps/dataset_api.py b/api/apps/dataset_api.py index 94b75fe6a..09f82e38e 100644 --- a/api/apps/dataset_api.py +++ b/api/apps/dataset_api.py @@ -82,8 +82,8 @@ def create_dataset(): # In case that the length of the name exceeds the limit dataset_name_length = len(dataset_name) if dataset_name_length > NAME_LENGTH_LIMIT: - return construct_json_result( - message=f"Dataset name: {dataset_name} with length {dataset_name_length} exceeds {NAME_LENGTH_LIMIT}!") + return construct_json_result(code=RetCode.DATA_ERROR, + message=f"Dataset name: {dataset_name} with length {dataset_name_length} exceeds {NAME_LENGTH_LIMIT}!") # In case that there are other fields in the data-binary if len(request_body.keys()) > 1: @@ -177,11 +177,6 @@ def get_dataset(): return construct_json_result(e) # ------------------------------ update a dataset -------------------------------------------- -@manager.route('/', methods=['GET']) -@login_required -def get_dataset(dataset_id): - return construct_json_result(code=RetCode.DATA_ERROR, message=f"attempt to get detail of dataset: {dataset_id}") - @manager.route('/', methods=['PUT']) @login_required @validate_request("name")