mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 15:40:12 +01:00
🎨 API listDocsByPath add an optional parameter maxListCount Fix https://github.com/siyuan-note/siyuan/issues/7993
This commit is contained in:
parent
ee3138be64
commit
31e1966ffa
1 changed files with 5 additions and 0 deletions
|
|
@ -18,6 +18,7 @@ package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"math"
|
||||||
"net/http"
|
"net/http"
|
||||||
"path"
|
"path"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
|
@ -621,7 +622,11 @@ func listDocsByPath(c *gin.Context) {
|
||||||
}
|
}
|
||||||
maxListCount := model.Conf.FileTree.MaxListCount
|
maxListCount := model.Conf.FileTree.MaxListCount
|
||||||
if arg["maxListCount"] != nil {
|
if arg["maxListCount"] != nil {
|
||||||
|
// API `listDocsByPath` add an optional parameter `maxListCount` https://github.com/siyuan-note/siyuan/issues/7993
|
||||||
maxListCount = int(arg["maxListCount"].(float64))
|
maxListCount = int(arg["maxListCount"].(float64))
|
||||||
|
if 0 == maxListCount {
|
||||||
|
maxListCount = math.MaxInt
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
files, totals, err := model.ListDocTree(notebook, p, sortMode, flashcard, maxListCount)
|
files, totals, err := model.ListDocTree(notebook, p, sortMode, flashcard, maxListCount)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue