Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
MorvanZhou committed Oct 18, 2023
1 parent 02fc727 commit 4038165
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = rethink-note
version = 0.1.7
version = 0.1.8
author = MorvanZhou
author_email = [email protected]
description = note taking app
Expand Down
2 changes: 1 addition & 1 deletion src/rethink/controllers/search/node_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def cursor_query(
message=const.get_msg_by_code(code, td.language),
requestId=req.requestId,
result=schemas.search.CursorQueryResponse.Result(
nodes=[schemas.node.NodesInfoResponse.NodeInfo(
nodes=[schemas.node.NodesInfoResponse.Data.NodeInfo(
id=n["id"],
title=n["title"],
snippet=n["snippet"],
Expand Down
16 changes: 16 additions & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,22 @@ def test_node(self):
rj = resp.json()
self.assertEqual(0, rj["code"])

resp = self.client.post(
"/api/search/cursor",
json={
"requestId": "xxx",
"nid": node["id"],
"textBeforeCursor": "@How",
},
headers={"token": self.token},
)
rj = resp.json()
self.assertEqual(0, rj["code"])
self.assertEqual("xxx", rj["requestId"])
self.assertEqual("How", rj["result"]["query"])
self.assertEqual(1, len(rj["result"]["nodes"]))
self.assertEqual("How do I record", rj["result"]["nodes"][0]["title"])

self.client.put(
"/api/trash",
json={
Expand Down

0 comments on commit 4038165

Please sign in to comment.