From d208a254a97d5ca5402746d3f595c34432641dfa Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Wed, 14 Jun 2017 12:31:39 -0700 Subject: [PATCH] Add /tag/abcd/edit endpoint, no interface yet. --- .../etiquette_flask/etiquette_flask/etiquette_flask.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontends/etiquette_flask/etiquette_flask/etiquette_flask.py b/frontends/etiquette_flask/etiquette_flask/etiquette_flask.py index da888cc..cb0bedd 100644 --- a/frontends/etiquette_flask/etiquette_flask/etiquette_flask.py +++ b/frontends/etiquette_flask/etiquette_flask/etiquette_flask.py @@ -765,6 +765,16 @@ def get_tags_json(specific_tag=None): tags = [etiquette.jsonify.tag(tag, include_synonyms=include_synonyms) for tag in tags] return jsonify.make_json_response(tags) +@site.route('/tag//edit', methods=['POST']) +def post_tag_edit(specific_tag): + tag = P_tag(specific_tag) + description = request.form.get('description', None) + tag.edit(description=description) + + response = etiquette.jsonify.tag(tag) + response = jsonify.make_json_response(response) + return response + @site.route('/tags/') @site.route('/tags/.json') def get_tags_specific_redirect(specific_tag=None):