feat: nested department sections, attaching department sections in the user editor

This commit is contained in:
2025-01-19 12:01:10 +04:00
parent 43a95ef75c
commit b8947ce68e
7 changed files with 198 additions and 32 deletions

View File

@@ -59,6 +59,17 @@ async def delete_department(
return await DepartmentService(session).delete_department(department_id)
@department_router.get(
"/section",
operation_id="get_sections",
response_model=GetDepartmentSectionsResponse,
)
async def get_sections(
session: SessionDependency,
):
return await DepartmentService(session).get_sections()
@department_router.post(
"/section",
operation_id="create_section",

View File

@@ -35,6 +35,19 @@ async def update(
return await UserService(session).update(request)
@user_router.post(
'/update/department-sections/{user_id}',
response_model=UpdateUserDepartmentSectionsResponse,
operation_id='update_user_department_sections'
)
async def update_user_department_sections(
session: SessionDependency,
user_id: int,
request: UpdateUserDepartmentSectionsRequest,
):
return await UserService(session).update_department_sections(user_id, request)
@user_router.post(
'/create',
response_model=CreateUserResponse,