23 lines
653 B
Python
23 lines
653 B
Python
import logging
|
|
|
|
from fasthtml.fastapp import fast_app
|
|
|
|
from components.undo_redo.constants import Routes
|
|
from core.instance_manager import debug_session, InstanceManager
|
|
|
|
logger = logging.getLogger("UndoRedoApp")
|
|
|
|
undo_redo_app, rt = fast_app()
|
|
|
|
|
|
@rt(Routes.Undo)
|
|
def post(session, _id: str):
|
|
logger.debug(f"Entering {Routes.Undo} with args {debug_session(session)}, {_id=}")
|
|
instance = InstanceManager.get(session, _id)
|
|
return instance.undo()
|
|
|
|
@rt(Routes.Redo)
|
|
def post(session, _id: str):
|
|
logger.debug(f"Entering {Routes.Redo} with args {debug_session(session)}, {_id=}")
|
|
instance = InstanceManager.get(session, _id)
|
|
return instance.redo() |