Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions application/tests/web_main_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,14 @@ def test_test_search(self) -> None:
self.assertEqual(200, resp.status_code)
self.assertDictEqual(resp.json[0], expected[0])

def test_text_search_missing_param(self) -> None:
with self.app.test_client() as client:
response = client.get("/rest/v1/text_search")
self.assertEqual(400, response.status_code)

response = client.get("/rest/v1/text_search?text=")
self.assertEqual(400, response.status_code)

def test_find_root_cres(self) -> None:
self.maxDiff = None
collection = db.Node_collection().with_graph()
Expand Down
2 changes: 2 additions & 0 deletions application/web/web_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,8 @@ def text_search() -> Any:
"""
database = db.Node_collection()
text = request.args.get("text")
if not text:
abort(400, "text parameter is required")
if posthog:
posthog.capture(f"text_search", f"text:{text}")

Expand Down