diff --git a/api/ovdashboard_api/routers/v1/_list_manager.py b/api/ovdashboard_api/routers/v1/_list_manager.py index 67bea50..9849ff8 100644 --- a/api/ovdashboard_api/routers/v1/_list_manager.py +++ b/api/ovdashboard_api/routers/v1/_list_manager.py @@ -34,6 +34,10 @@ class ListManager: prefix: str, names: list[str] = Depends(lister.func), ) -> list[str]: + """ + Filters `names` from an async source for names starting with a given prefix. + """ + if isinstance(names, params.Depends): names = await lister.func() @@ -45,6 +49,12 @@ class ListManager: prefix: str, names: list[str] = Depends(_filter_fn), ) -> str: + """ + Determines if a given prefix is unique in the async produced list `names`. + + On success, produces the unique name with that prefix. Otherwise, throws a HTTPException. + """ + if isinstance(names, params.Depends): names = await _filter_fn(prefix)