mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
changed registering troute info are not stored to callback
This commit is contained in:
parent
cdd6bd9c52
commit
cc9dd16d98
3 changed files with 38 additions and 41 deletions
|
|
@ -10,21 +10,9 @@ from .lib import (
|
|||
|
||||
def route(path, url_prefix="", methods=[]):
|
||||
def decorator(callback):
|
||||
@wraps(callback)
|
||||
def wrapper(*args, **kwargs):
|
||||
return callback(*args, **kwargs)
|
||||
|
||||
func = wrapper
|
||||
func.restapi = True
|
||||
func.path = path
|
||||
func.methods = methods
|
||||
func.url_prefix = url_prefix
|
||||
if hasattr(callback, "__self__"):
|
||||
func.__self__ = callback.__self__
|
||||
func.callback = callback
|
||||
|
||||
RestApiFactory.register_route(func)
|
||||
return func
|
||||
RestApiFactory.register_route(path, callback, url_prefix, methods)
|
||||
callback.restapi = True
|
||||
return callback
|
||||
return decorator
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue