mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 08:38:28 +00:00
fix: [Tags + api] fix dict keys name + fix documentation errors output
This commit is contained in:
parent
44cf5bb4af
commit
5f5e86bb13
2 changed files with 23 additions and 23 deletions
|
@ -141,14 +141,14 @@ def remove_item_tags(tags=[], item_id=None):
|
||||||
return ({'status': 'error', 'reason': 'No Tag(s) specified'}, 400)
|
return ({'status': 'error', 'reason': 'No Tag(s) specified'}, 400)
|
||||||
|
|
||||||
dict_res = {}
|
dict_res = {}
|
||||||
dict_res[tags] = []
|
dict_res['tags'] = []
|
||||||
for tag in tags:
|
for tag in tags:
|
||||||
res = remove_item_tag(tag, item_id)
|
res = remove_item_tag(tag, item_id)
|
||||||
if res[1] != 200:
|
if res[1] != 200:
|
||||||
return res
|
return res
|
||||||
else:
|
else:
|
||||||
dict_res[tags].append(tag)
|
dict_res[tags].append(tag)
|
||||||
dict_res[id] = item_id
|
dict_res['id'] = item_id
|
||||||
return (dict_res, 200)
|
return (dict_res, 200)
|
||||||
|
|
||||||
# TEMPLATE + API QUERY
|
# TEMPLATE + API QUERY
|
||||||
|
|
|
@ -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`
|
**HTTP Status Code** : `400`
|
||||||
|
|
||||||
```
|
```json
|
||||||
{'status': 'error', 'reason': 'Item not found'}
|
{"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`
|
**HTTP Status Code** : `400`
|
||||||
|
|
||||||
```
|
```json
|
||||||
{'status': 'error', 'reason': 'Item not found'}
|
{"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`
|
**HTTP Status Code** : `400`
|
||||||
|
|
||||||
```
|
```json
|
||||||
{'status': 'error', 'reason': 'Item not found'}
|
{"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
|
#### Expected Fail Response
|
||||||
**HTTP Status Code** : `400`
|
**HTTP Status Code** : `400`
|
||||||
|
|
||||||
```
|
```json
|
||||||
{'status': 'error', 'reason': 'Item id not found'}
|
{"status": "error", "reason": "Item id not found"}
|
||||||
{'status': 'error', 'reason': 'Tags or Galaxy not specified'}
|
{"status": "error", "reason": "Tags or Galaxy not specified"}
|
||||||
{'status': 'error', 'reason': 'Tags or Galaxy not enabled'}
|
{"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
|
#### Expected Fail Response
|
||||||
**HTTP Status Code** : `400`
|
**HTTP Status Code** : `400`
|
||||||
|
|
||||||
```
|
```json
|
||||||
{'status': 'error', 'reason': 'Item id not found'}
|
{"status": "error", "reason": "Item id not found"}
|
||||||
{'status': 'error', 'reason': 'No Tag(s) specified'}
|
{"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
|
#### Expected Fail Response
|
||||||
**HTTP Status Code** : `400`
|
**HTTP Status Code** : `400`
|
||||||
|
|
||||||
```
|
```json
|
||||||
{'status': 'error', 'reason': 'Malformed JSON'}
|
{"status": "error", "reason": "Malformed JSON"}
|
||||||
{'status': 'error', 'reason': 'No text supplied'}
|
{"status": "error", "reason": "No text supplied"}
|
||||||
{'status': 'error', 'reason': 'Tags or Galaxy not enabled'}
|
{"status": "error", "reason": "Tags or Galaxy not enabled"}
|
||||||
{'status': 'error', 'reason': 'Size exceeds default'}
|
{"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`
|
**HTTP Status Code** : `400`
|
||||||
|
|
||||||
```
|
```json
|
||||||
{'status': 'error', 'reason': 'Invalid uuid'}
|
{"status": "error", "reason": "Invalid uuid"}
|
||||||
{'status': 'error', 'reason': 'Unknow uuid'}
|
{"status": "error", "reason": "Unknow uuid"}
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue