mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-08-27 12:30:13 +03:00
Fix: add missing _filter_link_response function
Previously the function was referenced in create_link_handler but never defined, causing NameError at runtime.
This commit is contained in:
parent
1bb010d274
commit
b79fb89866
@ -96,6 +96,16 @@ VALID_LINK_FIELDS = {
|
||||
}
|
||||
|
||||
|
||||
LINK_DEFAULT_FIELDS = ["link_id", "link_type", "nodes"]
|
||||
|
||||
|
||||
def _filter_link_response(link: dict, fields: list[str] = None) -> dict:
|
||||
"""Filter link response to only include requested fields."""
|
||||
if not fields:
|
||||
fields = LINK_DEFAULT_FIELDS
|
||||
return {k: link[k] for k in fields if k in link}
|
||||
|
||||
|
||||
def get_links_handler(params: dict[str, Any], gns3_ctx: dict[str, Any]) -> dict[str, Any]:
|
||||
project_id = params.get("project_id")
|
||||
if not project_id:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user