Corrected code to handle template types

This commit is contained in:
Ken Tsang
2017-04-18 16:19:25 +01:00
parent ed953e992d
commit fc0cfa5dbf
3 changed files with 37 additions and 4 deletions

View File

@@ -10,9 +10,9 @@ from app.v2.templates.templates_schemas import get_all_template_request
@v2_templates_blueprint.route("/", methods=['GET'])
def get_templates():
validate(request.args.to_dict(), get_all_template_request)
data = validate(request.args.to_dict(), get_all_template_request)
templates = templates_dao.dao_get_all_templates_for_service(api_user.service_id)
templates = templates_dao.dao_get_all_templates_for_service(api_user.service_id, data.get('type'))
return jsonify(
templates=[template.serialize() for template in templates]