From b635131195fa49f9ab59f61e44b0fe1f58db1e8a Mon Sep 17 00:00:00 2001 From: viktot14-ai Date: Wed, 9 Sep 2026 22:43:13 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20unit=5Fname=20=D0=B2=20DTO=20=D0=BE?= =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B0=D1=86=D0=B8=D0=B9=20(=D1=81=D0=B8?= =?UTF-8?q?=D0=B3=D0=BD=D0=B0=D1=82=D1=83=D1=80=D0=B0=20=5Foperation=5Fdto?= =?UTF-8?q?=20=D1=81=20units=5Fby=5Fid)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/routers/operations.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/routers/operations.py b/backend/routers/operations.py index 2be4eeb..4808639 100644 --- a/backend/routers/operations.py +++ b/backend/routers/operations.py @@ -94,14 +94,17 @@ def list_operations( return {'items': [_operation_dto(o, users_by_id, units_by_id) for o in ops], 'total': len(ops)} -def _operation_dto(op: SearchOperation, users_by_id: dict | None = None) -> dict[str, Any]: +def _operation_dto(op: SearchOperation, users_by_id: dict | None = None, + units_by_id: dict | None = None) -> dict[str, Any]: u = users_by_id or {} + units = units_by_id or {} return { 'id': str(op.id), 'title': op.title, 'case_id': str(op.case_id), 'status': op.status, 'unit_id': str(op.unit_id) if op.unit_id else None, + 'unit_name': units.get(str(op.unit_id)) if op.unit_id else None, 'contour_operation_id': str(op.contour_operation_id) if op.contour_operation_id else None, 'created_by_name': u.get(str(op.created_by)) if op.created_by else None, 'created_at': op.created_at.isoformat() if op.created_at else None,