Skip to content

Commit

Permalink
Moved to canonical JSON post for search
Browse files Browse the repository at this point in the history
  • Loading branch information
keul committed Sep 9, 2024
1 parent daf9061 commit bf61aa6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cads_catalogue_api_service/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.

import enum
from typing import Annotated, Any
from typing import Any

import attr
import fastapi
Expand Down Expand Up @@ -67,6 +67,8 @@ def datasets_search(


class FormData(pydantic.BaseModel):
"""Search datasets valid payload."""

q: str = ""
kw: list[str] | None = []
idx: list[str] | None = []
Expand All @@ -76,9 +78,7 @@ class FormData(pydantic.BaseModel):
search_stats: bool = True


def datasets_search_post(
request: fastapi.Request, data: Annotated[FormData, fastapi.Form()]
) -> dict[str, Any]:
def datasets_search_post(request: fastapi.Request, data: FormData) -> dict[str, Any]:
"""Filter datasets based on search parameters."""
return datasets_search(
request=request,
Expand Down

0 comments on commit bf61aa6

Please sign in to comment.