Журнал перемещений, упрощение и чистка
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
from fastapi import APIRouter, Depends
|
||||
from db.handlers.actions import StocksActions
|
||||
from utils import requestDict, logger
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.post("/")
|
||||
async def post_requests(
|
||||
reqData: dict = Depends(requestDict),
|
||||
):
|
||||
logger.info("Получение записи о перемещении инструмента")
|
||||
request_id = reqData.get("body").get("request_id")
|
||||
user_id = reqData.get("body").get("user_id")
|
||||
accepted = reqData.get("body").get("accepted")
|
||||
if request_id and user_id and accepted is not None:
|
||||
result = await StocksActions.movingDecision(int(request_id), user_id, accepted)
|
||||
if result:
|
||||
return {"status": "ok"}
|
||||
return {"status": "error"}
|
||||
Reference in New Issue
Block a user