Skip to content

Commit 6d996fb

Browse files
committed
fix(list_incidents): Fix the source_id filtering
Issue: APPAI-162
1 parent 48b4e6b commit 6d996fb

File tree

1 file changed

+6
-3
lines changed
  • packages/gg_api_core/src/gg_api_core

1 file changed

+6
-3
lines changed

packages/gg_api_core/src/gg_api_core/client.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -893,16 +893,19 @@ async def list_incidents(
893893
params["assignee_email"] = assignee_email
894894
if assignee_id:
895895
params["assignee_id"] = assignee_id
896-
if source_id:
897-
params["source_id"] = source_id
898896
if per_page:
899897
params["per_page"] = str(per_page)
900898
if cursor:
901899
params["cursor"] = cursor
902900
if ordering:
903901
params["ordering"] = ordering
904902

905-
endpoint = "/incidents/secrets"
903+
# Use source-specific endpoint when source_id is provided
904+
# The /incidents/secrets endpoint silently ignores source_id query param
905+
if source_id:
906+
endpoint = f"/sources/{source_id}/incidents/secrets"
907+
else:
908+
endpoint = "/incidents/secrets"
906909

907910
if get_all:
908911
# When get_all=True, return all items without cursor

0 commit comments

Comments
 (0)