mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Spaced repetition interface supports review by document selection https://github.com/siyuan-note/siyuan/issues/7954
This commit is contained in:
parent
0ebdd49f8a
commit
66bd5e91a5
7 changed files with 112 additions and 38 deletions
|
|
@ -308,11 +308,27 @@ func lsNotebooks(c *gin.Context) {
|
|||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
notebooks, err := model.ListNotebooks()
|
||||
if nil != err {
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
flashcard := false
|
||||
if arg["flashcard"] != nil {
|
||||
flashcard = arg["flashcard"].(bool)
|
||||
}
|
||||
|
||||
var notebooks []*model.Box
|
||||
if flashcard {
|
||||
notebooks = model.GetFlashcardNotebooks()
|
||||
} else {
|
||||
var err error
|
||||
notebooks, err = model.ListNotebooks()
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
ret.Data = map[string]interface{}{
|
||||
"notebooks": notebooks,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue