Skip to content

Commit d957cce

Browse files
committed
Refactor search service to use scope values in API requests; add validation for project search scopes and enhance error details in exceptions.
1 parent 8469138 commit d957cce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/services/search.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async def search_globally(search_term: str, scope: SearchScope) -> list[Any]:
4343
response = await gitlab_rest_client.get_async(
4444
"/search",
4545
params={
46-
"scope": search_request.scope,
46+
"scope": search_request.scope.value,
4747
"search": search_request.search,
4848
},
4949
)
@@ -79,7 +79,7 @@ async def search_group(
7979
response = await gitlab_rest_client.get_async(
8080
f"/groups/{search_request.group_id}/search",
8181
params={
82-
"scope": search_request.scope,
82+
"scope": search_request.scope.value,
8383
"search": search_request.search,
8484
},
8585
)
@@ -114,7 +114,7 @@ async def search_project(input_model: ProjectSearchRequest) -> list[Any]:
114114

115115
try:
116116
params = {
117-
"scope": input_model.scope,
117+
"scope": input_model.scope.value,
118118
"search": input_model.search,
119119
}
120120
if input_model.ref:

0 commit comments

Comments
 (0)