Skip to content

Commit

Permalink
fix: fix keyword search error
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Feb 27, 2024
1 parent 3caa7a2 commit 6ed52a7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 6 additions & 0 deletions libs/zhi-siyuan-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# zhi-siyuan-api

## 2.16.0

### Minor Changes

- fix keyword search error

## 2.15.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion libs/zhi-siyuan-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zhi-siyuan-api",
"version": "2.15.2",
"version": "2.16.0",
"type": "module",
"description": "a siyuan-note api including both kernel and client",
"main": "./dist/index.js",
Expand Down
3 changes: 1 addition & 2 deletions libs/zhi-siyuan-api/src/lib/adaptor/siYuanApiAdaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ class SiYuanApiAdaptor extends BlogApi {
const k = keyword ?? ""
const siyuanPosts = await this.siyuanKernelApi.getRootBlocks(pg, numOfPosts, k)

this.logger.debug("getRecentPosts from siyuan, get counts =>", siyuanPosts.length)
if (siyuanPosts && siyuanPosts.length && siyuanPosts.length > 0) {
if (siyuanPosts?.length > 0) {
for (let i = 0; i < siyuanPosts.length; i++) {
const siyuanPost = siyuanPosts[i]
const post = await this.getPost(siyuanPost.root_id, false, true)
Expand Down

0 comments on commit 6ed52a7

Please sign in to comment.