From ae88193c5153aa04226a8307e1294a9c75d312bb Mon Sep 17 00:00:00 2001 From: zhaoqingang <zhaoqg0118@163.com> Date: 星期三, 18 十二月 2024 18:30:03 +0800 Subject: [PATCH] add dialog sss --- app/api/organization.py | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/api/organization.py b/app/api/organization.py index eab77c7..fcb2447 100644 --- a/app/api/organization.py +++ b/app/api/organization.py @@ -19,7 +19,7 @@ async def add_dept(dept: DeptInfo, current_user: UserModel = Depends(get_current_user), db=Depends(get_db)): if not dept.deptName: return Response(code=400, msg="The deptName cannot be empty!") - if dept.status not in ["0", "1"]: + if dept.status not in ["0", "1", 0, 1]: return Response(code=400, msg="The status cannot be {}!".format(dept.status)) is_create = await create_dept(db, dept.deptName, dept.leader, dept.phone, dept.address, dept.status, dept.orderNum, dept.roles, dept.groups, dept.parentId) if not is_create: @@ -62,9 +62,9 @@ @dept_router.put("/status", response_model=Response) async def edit_status_api(dept: DeptStatus, current_user: UserModel = Depends(get_current_user), db=Depends(get_db)): - if dept.status not in ["0", '1']: + if dept.status not in ["0", '1', 0, 1]: return Response(code=400, msg="鏈煡鐘舵�侊紒", data={}) - msg = await edit_organization_status(db, dept.deptId, dept.status) + msg = await edit_organization_status(db, dept.deptId, str(dept.status)) if msg: return Response(code=400, msg=f"{msg}", data={}) return Response(code=200, msg="dept delete successfully", data={}) -- Gitblit v1.8.0