server/tags: change response key

Since we're using "results" everywhere else, it makes little sense for
tag siblings to use "siblings" node.
This commit is contained in:
rr- 2016-05-22 11:05:18 +02:00
parent 16d4d3ca68
commit cf3b97b8de
3 changed files with 3 additions and 3 deletions

2
API.md
View file

@ -491,7 +491,7 @@ data.
```json5 ```json5
{ {
"siblings": [ "results": [
{ {
"tag": <tag>, "tag": <tag>,
"occurrences": <occurrence-count> "occurrences": <occurrence-count>

View file

@ -100,4 +100,4 @@ class TagSiblingsApi(BaseApi):
'tag': tags.serialize_tag(sibling), 'tag': tags.serialize_tag(sibling),
'occurrences': occurrences 'occurrences': occurrences
}) })
return {'siblings': serialized_siblings} return {'results': serialized_siblings}

View file

@ -5,7 +5,7 @@ from szurubooru.func import util, tags
def assert_results(result, expected_tag_names_and_occurrences): def assert_results(result, expected_tag_names_and_occurrences):
actual_tag_names_and_occurences = {} actual_tag_names_and_occurences = {}
for item in result['siblings']: for item in result['results']:
tag_name = item['tag']['names'][0] tag_name = item['tag']['names'][0]
occurrences = item['occurrences'] occurrences = item['occurrences']
actual_tag_names_and_occurences[tag_name] = occurrences actual_tag_names_and_occurences[tag_name] = occurrences