редактирование ящика
This commit is contained in:
+13
-1
@@ -16,7 +16,19 @@ async def add_toolbox(reqDict=Depends(requestDict)):
|
||||
result = await ToolboxHandler.add(toolboxData, userId)
|
||||
if result:
|
||||
response["status"] = "ok"
|
||||
logger.info(response)
|
||||
return response
|
||||
|
||||
|
||||
@router.put("/", summary="Обновление ящика")
|
||||
async def update_toolbox(reqDict=Depends(requestDict)):
|
||||
toolboxId = reqDict.get("body").get("toolboxId")
|
||||
logger.info(f"Обновление ящика #{toolboxId}")
|
||||
response = {"status": "error"}
|
||||
userId = reqDict.get("body").get("userId")
|
||||
toolboxData = reqDict.get("body").get("editToolboxData")
|
||||
result = await ToolboxHandler.edit(toolboxId, **toolboxData, user_id=userId)
|
||||
if result:
|
||||
response["status"] = "ok"
|
||||
return response
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user