cecilia-uu commited on
Commit
9bca6cf
·
1 Parent(s): a009daf

added documentation for api and fixed: duplicate get_dataset() (#1190)

Browse files

### 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

Files changed (1) hide show
  1. api/apps/dataset_api.py +2 -7
api/apps/dataset_api.py CHANGED
@@ -82,8 +82,8 @@ def create_dataset():
82
  # In case that the length of the name exceeds the limit
83
  dataset_name_length = len(dataset_name)
84
  if dataset_name_length > NAME_LENGTH_LIMIT:
85
- return construct_json_result(
86
- message=f"Dataset name: {dataset_name} with length {dataset_name_length} exceeds {NAME_LENGTH_LIMIT}!")
87
 
88
  # In case that there are other fields in the data-binary
89
  if len(request_body.keys()) > 1:
@@ -177,11 +177,6 @@ def get_dataset():
177
  return construct_json_result(e)
178
 
179
  # ------------------------------ update a dataset --------------------------------------------
180
- @manager.route('/<dataset_id>', methods=['GET'])
181
- @login_required
182
- def get_dataset(dataset_id):
183
- return construct_json_result(code=RetCode.DATA_ERROR, message=f"attempt to get detail of dataset: {dataset_id}")
184
-
185
  @manager.route('/<dataset_id>', methods=['PUT'])
186
  @login_required
187
  @validate_request("name")
 
82
  # In case that the length of the name exceeds the limit
83
  dataset_name_length = len(dataset_name)
84
  if dataset_name_length > NAME_LENGTH_LIMIT:
85
+ return construct_json_result(code=RetCode.DATA_ERROR,
86
+ message=f"Dataset name: {dataset_name} with length {dataset_name_length} exceeds {NAME_LENGTH_LIMIT}!")
87
 
88
  # In case that there are other fields in the data-binary
89
  if len(request_body.keys()) > 1:
 
177
  return construct_json_result(e)
178
 
179
  # ------------------------------ update a dataset --------------------------------------------
 
 
 
 
 
180
  @manager.route('/<dataset_id>', methods=['PUT'])
181
  @login_required
182
  @validate_request("name")