Let /tag/tagname.json only return the one main tag, not list.

Previously, the whole walk tree was returned. This can be convenient
because you get the whole descendant tree all at once, but it's
unusual since all the other individual .json endpoints only return a
single object, not a list.
This commit is contained in:
voussoir 2021-01-07 22:52:42 -08:00
parent 500f07283f
commit 84b4595454

View file

@ -146,13 +146,13 @@ def get_tags_json(specific_tag_name=None):
include_synonyms = request.args.get('synonyms')
include_synonyms = include_synonyms is None or etiquette.helpers.truthystring(include_synonyms)
if specific_tag is None:
tags = list(common.P.get_tags())
if specific_tag:
response = specific_tag.jsonify(include_synonyms=include_synonyms)
else:
tags = list(specific_tag.walk_children())
tags = list(common.P.get_tags())
response = [tag.jsonify(include_synonyms=include_synonyms) for tag in tags]
tags = [tag.jsonify(include_synonyms=include_synonyms) for tag in tags]
return jsonify.make_json_response(tags)
return jsonify.make_json_response(response)
# Tag create and delete ############################################################################