File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed
services/web/server/src/simcore_service_webserver Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 1- from typing import TypedDict
1+ from typing import TypeAlias , TypedDict
2+
3+ from models_library .api_schemas_catalog .services import MyServicesRpcBatchGet
24
35
46class ServiceKeyVersionDict (TypedDict ):
57 key : str
68 version : str
9+
10+
11+ MyServicesBatchGetResult : TypeAlias = MyServicesRpcBatchGet
Original file line number Diff line number Diff line change 33from typing import Any , cast
44
55from aiohttp import web
6- from models_library .api_schemas_catalog .services import MyServiceGet , ServiceUpdateV2
6+ from models_library .api_schemas_catalog .services import ServiceUpdateV2
77from models_library .api_schemas_webserver .catalog import (
88 ServiceInputGet ,
99 ServiceInputKey ,
3737 ServiceInputGetFactory ,
3838 ServiceOutputGetFactory ,
3939)
40+ from ._models import MyServicesBatchGetResult
4041from ._units_service import can_connect , replace_service_input_outputs
4142
4243_logger = logging .getLogger (__name__ )
@@ -97,7 +98,7 @@ async def batch_get_my_services(
9798 user_id : UserID ,
9899 product_name : ProductName ,
99100 services_ids : list [tuple [ServiceKey , ServiceVersion ]],
100- ) -> list [ MyServiceGet ] :
101+ ) -> MyServicesBatchGetResult :
101102 try :
102103
103104 return await catalog_rpc .batch_get_my_services (
Original file line number Diff line number Diff line change 99from models_library .api_schemas_catalog .service_access_rights import (
1010 ServiceAccessRightsGet ,
1111)
12- from models_library .api_schemas_catalog .services import MyServiceGet
1312from models_library .api_schemas_directorv2 .dynamic_services import DynamicServiceGet
1413from models_library .api_schemas_dynamic_scheduler .dynamic_services import (
1514 DynamicServiceStop ,
@@ -547,19 +546,23 @@ async def get_project_services(request: web.Request) -> web.Response:
547546 )
548547 )
549548
550- services : list [ MyServiceGet ] = await catalog_service .batch_get_my_services (
549+ batch_got = await catalog_service .batch_get_my_services (
551550 request .app ,
552551 product_name = req_ctx .product_name ,
553552 user_id = req_ctx .user_id ,
554553 services_ids = services_in_project ,
555554 )
556555
556+ #
557+ # FIXME: in "data" we return list[ProjectNodeServiceGet] that were found
558+ # in "error" we return list[ServiceKeyVersion] that were not found!
559+ # returned lists should keep the order of services_in_project
557560 return envelope_json_response (
558561 ProjectNodeServicesGet (
559562 project_uuid = path_params .project_id ,
560563 services = [
561564 NodeServiceGet .model_validate (sv , from_attributes = True )
562- for sv in services
565+ for sv in batch_got . found_items
563566 ],
564567 )
565568 )
You can’t perform that action at this time.
0 commit comments