fix: [Tags + api] fix dict keys name + fix documentation errors output

This commit is contained in:
Terrtia 2019-07-31 11:15:34 +02:00
parent 44cf5bb4af
commit 5f5e86bb13
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0
2 changed files with 23 additions and 23 deletions

View file

@ -141,14 +141,14 @@ def remove_item_tags(tags=[], item_id=None):
return ({'status': 'error', 'reason': 'No Tag(s) specified'}, 400)
dict_res = {}
dict_res[tags] = []
dict_res['tags'] = []
for tag in tags:
res = remove_item_tag(tag, item_id)
if res[1] != 200:
return res
else:
dict_res[tags].append(tag)
dict_res[id] = item_id
dict_res['id'] = item_id
return (dict_res, 200)
# TEMPLATE + API QUERY

View file

@ -82,8 +82,8 @@ curl https://127.0.0.1:7000/api/get/item/info/submitted/2019/07/26/3efb8a79-08e9
**HTTP Status Code** : `400`
```
{'status': 'error', 'reason': 'Item not found'}
```json
{"status": "error", "reason": "Item not found"}
```
@ -129,8 +129,8 @@ curl https://127.0.0.1:7000/api/get/item/content/submitted/2019/07/26/3efb8a79-0
**HTTP Status Code** : `400`
```
{'status': 'error', 'reason': 'Item not found'}
```json
{"status": "error", "reason": "Item not found"}
```
@ -182,8 +182,8 @@ curl https://127.0.0.1:7000/api/get/item/tag/submitted/2019/07/26/3efb8a79-08e9-
**HTTP Status Code** : `400`
```
{'status': 'error', 'reason': 'Item not found'}
```json
{"status": "error", "reason": "Item not found"}
```
@ -253,10 +253,10 @@ curl https://127.0.0.1:7000/api/import/item --header "Authorization: iHc1_ChZxj1
#### Expected Fail Response
**HTTP Status Code** : `400`
```
{'status': 'error', 'reason': 'Item id not found'}
{'status': 'error', 'reason': 'Tags or Galaxy not specified'}
{'status': 'error', 'reason': 'Tags or Galaxy not enabled'}
```json
{"status": "error", "reason": "Item id not found"}
{"status": "error", "reason": "Tags or Galaxy not specified"}
{"status": "error", "reason": "Tags or Galaxy not enabled"}
```
@ -321,9 +321,9 @@ curl https://127.0.0.1:7000/api/delete/item/tag --header "Authorization: iHc1_Ch
#### Expected Fail Response
**HTTP Status Code** : `400`
```
{'status': 'error', 'reason': 'Item id not found'}
{'status': 'error', 'reason': 'No Tag(s) specified'}
```json
{"status": "error", "reason": "Item id not found"}
{"status": "error", "reason": "No Tag(s) specified"}
```
@ -398,11 +398,11 @@ curl https://127.0.0.1:7000/api/import/item --header "Authorization: iHc1_ChZxj1
#### Expected Fail Response
**HTTP Status Code** : `400`
```
{'status': 'error', 'reason': 'Malformed JSON'}
{'status': 'error', 'reason': 'No text supplied'}
{'status': 'error', 'reason': 'Tags or Galaxy not enabled'}
{'status': 'error', 'reason': 'Size exceeds default'}
```json
{"status": "error", "reason": "Malformed JSON"}
{"status": "error", "reason": "No text supplied"}
{"status": "error", "reason": "Tags or Galaxy not enabled"}
{"status": "error", "reason": "Size exceeds default"}
```
@ -458,7 +458,7 @@ curl -k https://127.0.0.1:7000/api/import/item/b20a69f1-99ad-4cb3-b212-7ce24b763
**HTTP Status Code** : `400`
```
{'status': 'error', 'reason': 'Invalid uuid'}
{'status': 'error', 'reason': 'Unknow uuid'}
```json
{"status": "error", "reason": "Invalid uuid"}
{"status": "error", "reason": "Unknow uuid"}
```