1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-12-22 08:56:17 +00:00

change route call method

This commit is contained in:
vincent 2021-01-16 09:44:06 +01:00
parent 22c3727784
commit e22620b147

View File

@ -27,12 +27,9 @@ api = Blueprint("api", __name__)
def api_routing(endpoint):
def decorator(func):
viewendpoint="{}.view".format(endpoint)
@api.route(endpoint, methods=["GET", "POST"])
@api.route(viewendpoint, methods=["GET", "POST"])
@functools.wraps(func)
def wrapper(*args, **kwargs):
return func(*args,**kwargs)
return wrapper
api.add_url_rule(endpoint,view_func=func, methods=["GET", "POST"])
api.add_url_rule(viewendpoint,view_func=func, methods=["GET", "POST"])
return func
return decorator