mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
🎨 Add parameter pageSize for kernel API /api/riff/getRiffCards Fix https://github.com/siyuan-note/siyuan/issues/10445
This commit is contained in:
parent
6f57cbb65b
commit
4173654203
2 changed files with 25 additions and 14 deletions
|
|
@ -86,7 +86,11 @@ func getNotebookRiffCards(c *gin.Context) {
|
|||
|
||||
notebookID := arg["id"].(string)
|
||||
page := int(arg["page"].(float64))
|
||||
blockIDs, total, pageCount := model.GetNotebookFlashcards(notebookID, page)
|
||||
pageSize := 20
|
||||
if nil != arg["pageSize"] {
|
||||
pageSize = int(arg["pageSize"].(float64))
|
||||
}
|
||||
blockIDs, total, pageCount := model.GetNotebookFlashcards(notebookID, page, pageSize)
|
||||
ret.Data = map[string]interface{}{
|
||||
"blocks": blockIDs,
|
||||
"total": total,
|
||||
|
|
@ -105,7 +109,11 @@ func getTreeRiffCards(c *gin.Context) {
|
|||
|
||||
rootID := arg["id"].(string)
|
||||
page := int(arg["page"].(float64))
|
||||
blockIDs, total, pageCount := model.GetTreeFlashcards(rootID, page)
|
||||
pageSize := 20
|
||||
if nil != arg["pageSize"] {
|
||||
pageSize = int(arg["pageSize"].(float64))
|
||||
}
|
||||
blockIDs, total, pageCount := model.GetTreeFlashcards(rootID, page, pageSize)
|
||||
ret.Data = map[string]interface{}{
|
||||
"blocks": blockIDs,
|
||||
"total": total,
|
||||
|
|
@ -124,7 +132,11 @@ func getRiffCards(c *gin.Context) {
|
|||
|
||||
deckID := arg["id"].(string)
|
||||
page := int(arg["page"].(float64))
|
||||
blocks, total, pageCount := model.GetDeckFlashcards(deckID, page)
|
||||
pageSize := 20
|
||||
if nil != arg["pageSize"] {
|
||||
pageSize = int(arg["pageSize"].(float64))
|
||||
}
|
||||
blocks, total, pageCount := model.GetDeckFlashcards(deckID, page, pageSize)
|
||||
ret.Data = map[string]interface{}{
|
||||
"blocks": blocks,
|
||||
"total": total,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue