-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement and test search function #24
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, this is great to have such a simple implementation of the search function
backend/maelstro/main.py
Outdated
@@ -100,6 +100,14 @@ def get_sources() -> list[dict[str, str]]: | |||
def get_destinations() -> list[dict[str, str]]: | |||
return config.get_destinations() | |||
|
|||
@app.post("/search/{src_name}") | |||
def post_search(src_name: str, data: Dict[str, Any]) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the signature should be:
from fastapi import Body
@app.post("/search/{src_name}")
def post_search(
src_name: str,
data: importance: Annotated[dict[str, Any], Body()],
):
Have not tried it, please let me know if this works or if you run into trouble
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the key word "importance" doesn't exist
but it works that way :
def post_search(src_name: str, data: Annotated[dict[str, Any], Body()] ):
8065639
to
752fe8b
Compare
7d76683
to
752fe8b
Compare
No description provided.