Skip to content
Snippets Groups Projects
Commit 780b817c authored by Arie Peterson's avatar Arie Peterson
Browse files

Return newly created tag

parent a6d6bb83
No related branches found
No related tags found
1 merge request!163Resolve "Extra info for User Management"
Pipeline #44040 failed with stages
in 2 minutes and 54 seconds
......@@ -13,6 +13,7 @@ class TagService:
tag = Tag(name=data["name"], colour=data.get("colour"))
db.session.add(tag)
db.session.commit()
return {"id": tag.id, "name": tag.name, "colour": tag.colour}
@staticmethod
def update_tag(id, data):
......
......@@ -25,8 +25,8 @@ def get_tags():
@admin_required()
def post_tag():
data = request.get_json()
TagService.create_tag(data)
return jsonify(message="Tag created successfully.")
tag = TagService.create_tag(data)
return jsonify(tag)
@api_v1.route("/tags/<int:id>", methods=["PUT"])
@jwt_required()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment